|
spot
2.16
|
#include <spot/misc/timer.hh>
Public Member Functions | |
| void | start () |
| Start a time interval. More... | |
| void | stop () |
| Stop a time interval and update the sum of all intervals. More... | |
| clock_t | utime () const |
| Return the user time of the current process (without children) of all accumulated interval. More... | |
| clock_t | cutime () const |
| Return the user time of children of all accumulated interval. More... | |
| clock_t | stime () const |
| Return the system time of the current process (without children) of all accumulated interval. More... | |
| clock_t | cstime () const |
| Return the system time of children of all accumulated interval. More... | |
| clock_t | get_uscp (bool user, bool system, bool children, bool parent) const |
| bool | is_running () const |
| Whether the timer is running. More... | |
| std::chrono::milliseconds::rep | walltime () const |
| Return cumulative wall time. More... | |
Protected Attributes | |
| time_info | start_ |
| Start time of the current interval. More... | |
| time_info | total_ |
| Accumulated time across all intervals. More... | |
| bool | running |
| std::chrono::steady_clock::time_point | wall_start_ |
| Wall-clock start time of the current interval. More... | |
| std::chrono::milliseconds::rep | wall_cumul_ = 0 |
| Wall time sum. More... | |
A timekeeper that accumulates intervals of time in a more detailed way. For instance, you can get the time spent with or without children processes.
|
inline |
Return the system time of children 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::cstime, and total_.
Referenced by get_uscp().
|
inline |
Return the user time of children 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::cutime, and total_.
Referenced by get_uscp().
|
inline |
Return accumulated CPU ticks for selected time components.
Each boolean flag selects a component: user/system time of the current process (parent) or its children.
References cstime(), cutime(), stime(), and utime().
Referenced by spot::process_timer::cputime().
|
inline |
Whether the timer is running.
References running.
|
inline |
Start a time interval.
References spot::time_info::cstime, spot::time_info::cutime, running, start_, spot::time_info::stime, spot::time_info::utime, and wall_start_.
Referenced by spot::process_timer::start().
|
inline |
Return the system time of the current process (without children) 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_.
Referenced by get_uscp().
|
inline |
Stop a time interval and update the sum of all intervals.
References spot::time_info::cstime, spot::time_info::cutime, running, start_, spot::time_info::stime, total_, spot::time_info::utime, wall_cumul_, and wall_start_.
Referenced by spot::process_timer::stop().
|
inline |
Return the user time of the current process (without children) 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.
Referenced by get_uscp().
|
inline |
Return cumulative wall time.
When using multithreading the cpu time is not relevant and we have to deal with wall time to have an effective timer
References wall_cumul_.
Referenced by spot::swarmed_bloemen< State, SuccIterator, StateHash, StateEqual >::walltime(), and spot::swarmed_bloemen_ec< State, SuccIterator, StateHash, StateEqual >::walltime().
|
protected |
Whether the timer is currently running.
Referenced by is_running(), start(), and stop().
|
protected |
|
protected |
|
protected |
Wall time sum.
Referenced by stop(), and walltime().
|
protected |
1.9.1