Class for measuring the cpu time and real time usage of the process. It is quite easy-to-use, here is a short example.
The Timer can also be stopped and started again, so it is possible to compute collected running times.
#include <lemon/time_measure.h>
Public Member Functions | |
Timer (bool run=true) | |
Constructor. | |
Control the State of the Timer | |
void | reset () |
Reset and stop the time counters. | |
void | start () |
Start the time counters. | |
void | stop () |
Stop the time counters. | |
void | halt () |
Halt (i.e stop immediately) the time counters. | |
int | running () |
Returns the running state of the timer. | |
void | restart () |
Restart the time counters. | |
Query Functions for the Ellapsed Time | |
double | userTime () const |
Gives back the ellapsed user time of the process. | |
double | systemTime () const |
Gives back the ellapsed system time of the process. | |
double | cUserTime () const |
Gives back the ellapsed user time of the process' children. | |
double | cSystemTime () const |
Gives back the ellapsed user time of the process' children. | |
double | realTime () const |
Gives back the ellapsed real time. | |
operator TimeStamp () const | |
Computes the ellapsed time. | |
|
inline |
run | indicates whether or not the timer starts immediately. |
|
inline |
This function resets and stops the time counters
|
inline |
|
inline |
|
inline |
|
inline |
This function returns the number of stop() exections that is necessary to really stop the timer. For example the timer is running if and only if the return value is true
(i.e. greater than zero).
|
inline |
WIN32
platform this value is not calculated.
|
inline |
WIN32
platform this value is not calculated.