12 #define DIGITS2( STREAM, TIME ) \ 19 if( ( TIME > 0 ) && ( TIME < 10 ) ) \ 30 clock_t value = clock( );
52 int elapsedHours =
static_cast< int >( AcS / 3600.0 );
53 AcS -=
static_cast< double >( elapsedHours * 3600 );
55 int elapsedMins =
static_cast< int >( AcS / 60.0 );
56 AcS -=
static_cast< double >( elapsedMins * 60 );
58 int elapsedSecs =
static_cast< int >( AcS );
59 AcS -=
static_cast< double >( elapsedSecs );
61 double elapsedMSecs = AcS * 1000.0;
71 o <<
" :: " << elapsedMSecs;
83 for(
int ii = 0; ii < t.
nTimers(); ii++ )
85 MaxNameSize = std::max( MaxNameSize,
91 for(
int ii = 0; ii < t.
nTimers(); ii++ )
93 Temp = MaxNameSize -
static_cast< int >( t.
processName( ii ).size() ) + 1;
95 Out << t.
processName( ii ) << std::string( Temp,
' ' )
96 <<
": " << t.
getTimer( ii ) << std::endl;
The timer class. Utility.
Timing class. Absolutely copied from GNU time. Take a look at
std::string & processName(int i)
Gets the process name (for reporting purposes).
PZResourceUsage resources
Information on the resources used.
#define DIGITS2(STREAM, TIME)
Define to print two digits (increment zeros)
void start()
Turns the timer on.
int nTimers() const
Number of active timers.
clock_t start
Wallclock time of process (start)
double AccumSec
Total accumulated time in seconds.
Controls several timers at once. Utility.
clock_t elapsed
Wallclock time of process (elapsed)
void stop()
Turns the timer off, and computes the elapsed time.
TPZTimer & getTimer(int i)
Returns a specific timer.
friend std::ostream & operator<<(std::ostream &Out, const TPZTimer &t)
Prints the time nicely formated.