A real time timer classMeasures real time. More...
|Create a new timer. Sets the time to zero. |
|Start the timer. This does not set the time to zero. |
|Stop the timer. Returns the elapsed time in seconds. |
|void||reset (double t=0.0)|
|Sets the time to time t, which is zero by default. Stops the timer if it is running. |
|Resets the timer and starts it. |
|Returns the elapsed time since last tic() |
|Prints the elapsed time since last tic() |
|double||get_time () const|
|Returns the elapsed time. |
|double||get_current_time () const|
|Vitrual function that returns teh current time. |
|The start time of the timer. |
|The stop time of the timer. |
|The ellapsed time from start to stop. |
|A bool that indicates if the timer is running or not. |
A real time timer class
Measures real time.
Usage: Define a time object:
It is possible to get elapsed time without stopping the timer. Observe that it is also possible to use the macros "time.tic();" to reset and start clock and "time.toc_print();" to print the elapsed time.