A real time timer class. More...
#include <itpp/base/timing.h>
Public Member Functions | |
Real_Timer () | |
Create a new timer. Sets the time to zero. More... | |
void | start (void) |
Start the timer. This does not set the time to zero. More... | |
double | stop (void) |
Stop the timer. Returns the elapsed time in seconds. More... | |
void | reset (double t=0.0) |
Sets the time to time t, which is zero by default. Stops the timer if it is running. More... | |
void | tic (void) |
Resets the timer and starts it. More... | |
double | toc (void) |
Returns the elapsed time since last tic() More... | |
void | toc_print (void) |
Prints the elapsed time since last tic() More... | |
double | get_time () const |
Returns the elapsed time. More... | |
Protected Member Functions | |
double | get_current_time () const |
Vitrual function that returns teh current time. More... | |
Protected Attributes | |
double | start_time |
The start time of the timer. More... | |
double | stop_time |
The stop time of the timer. More... | |
double | elapsed_time |
The ellapsed time from start to stop. More... | |
bool | running |
A bool that indicates if the timer is running or not. More... | |
A real time timer class.
Measures real time.
Usage: Define a time object:
Actions: Reset:
Start:
Stop:
Get time:
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.
|
inline |
|
protectedvirtual |
Vitrual function that returns teh current time.
Implements itpp::Timer.
Definition at line 146 of file timing.cpp.
|
inherited |
Start the timer. This does not set the time to zero.
Definition at line 85 of file timing.cpp.
References itpp::Timer::get_current_time(), itpp::Timer::running, and itpp::Timer::start_time.
Referenced by itpp::pause(), and itpp::Timer::tic().
|
inherited |
Stop the timer. Returns the elapsed time in seconds.
Definition at line 93 of file timing.cpp.
References itpp::Timer::elapsed_time, itpp::Timer::get_current_time(), itpp::Timer::running, itpp::Timer::start_time, and itpp::Timer::stop_time.
|
inherited |
Sets the time to time t, which is zero by default. Stops the timer if it is running.
Definition at line 104 of file timing.cpp.
References itpp::Timer::elapsed_time, itpp::Timer::running, itpp::Timer::start_time, and itpp::Timer::stop_time.
Referenced by itpp::Timer::tic(), and itpp::Timer::Timer().
|
inherited |
Resets the timer and starts it.
Definition at line 119 of file timing.cpp.
References itpp::Timer::reset(), and itpp::Timer::start().
Referenced by itpp::MOG_diag_EM_sup::ml_iterate(), and itpp::tic().
|
inherited |
Returns the elapsed time since last tic()
Definition at line 125 of file timing.cpp.
References itpp::Timer::get_time().
Referenced by itpp::MOG_diag_EM_sup::ml_iterate(), and itpp::toc().
|
inherited |
Prints the elapsed time since last tic()
Definition at line 130 of file timing.cpp.
References itpp::Timer::get_time().
Referenced by itpp::toc_print().
|
inherited |
Returns the elapsed time.
Definition at line 112 of file timing.cpp.
References itpp::Timer::elapsed_time, itpp::Timer::get_current_time(), itpp::Timer::running, and itpp::Timer::start_time.
Referenced by itpp::pause(), itpp::Timer::toc(), and itpp::Timer::toc_print().
|
protectedinherited |
The start time of the timer.
Definition at line 71 of file timing.h.
Referenced by itpp::Timer::get_time(), itpp::Timer::reset(), itpp::Timer::start(), and itpp::Timer::stop().
|
protectedinherited |
The stop time of the timer.
Definition at line 73 of file timing.h.
Referenced by itpp::Timer::reset(), and itpp::Timer::stop().
|
protectedinherited |
The ellapsed time from start to stop.
Definition at line 75 of file timing.h.
Referenced by itpp::Timer::get_time(), itpp::Timer::reset(), and itpp::Timer::stop().
|
protectedinherited |
A bool that indicates if the timer is running or not.
Definition at line 77 of file timing.h.
Referenced by itpp::Timer::get_time(), itpp::Timer::reset(), itpp::Timer::start(), and itpp::Timer::stop().
Generated on Sun Jun 5 2022 21:26:42 for IT++ by Doxygen 1.9.3