SyDEVS
v0.7
Simulation-based analysis of complex systems involving people, devices, physical elements, and dynamic environments.
|
A class for measuring and accumulating intervals of wallclock time. More...
#include <timer.h>
Public Member Functions | |
timer () | |
Constructs a timer that has not yet accumuated any interval measurements. More... | |
timer (duration cumulative_dt) | |
Constructs a timer that initially has a cumulative duration of cumulative_dt . More... | |
timer (const timer &)=delete | |
Copy constructor. More... | |
timer & | operator= (const timer &)=delete |
Copy assignment. More... | |
timer (timer &&)=default | |
Move constructor. More... | |
timer & | operator= (timer &&)=default |
Move assignment. More... | |
~timer ()=default | |
Destructor. More... | |
bool | timing () const |
Returns true if the timer has been started but not yet stopped. More... | |
duration | cumulative_duration () const |
Returns the cumulative duration of measured time. More... | |
void | start () |
Starts the timer. More... | |
duration | stop () |
Stops the timer and returns the measured interval of wallclock time. More... | |
A class for measuring and accumulating intervals of wallclock time.
A timer
object measures the interval of wallclock time that elapses between the point at which it is started and the point at which it is stopped. It also accumulates these time intervals. It can be used to measure how much is spent executing a block of code. All wallclock time durations are measured and reported in microseconds.
|
inline |
Constructs a timer that has not yet accumuated any interval measurements.
|
inlineexplicit |
Constructs a timer that initially has a cumulative duration of cumulative_dt
.
|
delete |
Copy constructor.
|
default |
Move constructor.
|
default |
Destructor.
|
inline |
Returns the cumulative duration of measured time.
|
inline |
Starts the timer.
|
inline |
Stops the timer and returns the measured interval of wallclock time.
|
inline |
Returns true
if the timer has been started but not yet stopped.