spot
1.0.2
|
A timekeeper that accumulate interval of time. More...
#include <misc/timer.hh>
Public Member Functions | |
timer () | |
void | start () |
Start a time interval. | |
void | stop () |
Stop a time interval and update the sum of all intervals. | |
clock_t | utime () const |
Return the user time of all accumulated interval. | |
clock_t | stime () const |
Return the system time of all accumulated interval. | |
bool | is_running () const |
Whether the timer is running. |
Protected Attributes | |
time_info | start_ |
time_info | total_ |
bool | running |
A timekeeper that accumulate interval of time.
|
inline |
|
inline |
Whether the timer is running.
References running.
|
inline |
Start a time interval.
References running, start_, spot::time_info::stime, and spot::time_info::utime.
|
inline |
Return the system time of all accumulated interval.
Any time interval that has been start()ed but not stop()ed will not be accounted for.
References spot::time_info::stime, and total_.
|
inline |
Stop a time interval and update the sum of all intervals.
References running, start_, spot::time_info::stime, total_, and spot::time_info::utime.
|
inline |
Return the user time of all accumulated interval.
Any time interval that has been start()ed but not stop()ed will not be accounted for.
References total_, and spot::time_info::utime.
|
protected |
Referenced by is_running(), start(), and stop().