A class for timing intervals while supporting pausing.
Definition at line 316 of file ge211_time.hxx.
Public Member Functions | |
Pausable_timer (bool start_paused=false) | |
Constructs a new pausable timer. More... | |
bool | is_paused () const |
Checks whether the timer is currently paused. | |
Duration | elapsed_time () const |
The elapsed time since the start or most recent reset, not counting paused times. | |
Duration | pause () |
Pauses the timer. More... | |
void | resume () |
Unpauses the timer. If the timer is already running, has no effect. | |
Duration | reset () |
Resets the timer, returning the elapsed time since starting or the most recent reset(). More... | |
|
inlineexplicit |
Constructs a new pausable timer.
The timer is started running by default, but can be started paused by passing true
.
Definition at line 321 of file ge211_time.hxx.
|
inline |
Pauses the timer.
If the timer is already paused, has no effect. In either case, the elapsed time thus far is saved, and can be queried with elapsed_time() const, or will continue to accumulate if we unpause().
Definition at line 353 of file ge211_time.hxx.
|
inline |
Resets the timer, returning the elapsed time since starting or the most recent reset().
Leaves the pause state unchanged.
Definition at line 374 of file ge211_time.hxx.