32 MyTimer( std::string str_name );
46 double GetTotalTime( std::string str_name = std::string() );
50 unsigned int GetNumberCalls( std::string str_name = std::string(
"default_timer") );
67 void Reset( std::string str_name = std::string(
"default_timer") );
97 typedef std::chrono::time_point< std::chrono::steady_clock, std::chrono::duration<double, std::ratio<1, 1000000000> > >
tpoint;
unsigned int GetNumberCalls(std::string str_name=std::string("default_timer"))
Get the number of calls (used for average)
tpoint stop_t
time_point, stopping time
OneTimer()
default constructor.
void Reset(std::string str_name=std::string("default_timer"))
Reset the timer.
unsigned int n_call
number of calls to stop/start
std::vector< double > GetAllTimes()
Get all computed times.
void Stop()
Stop the timer.
tpoint start_t
time_point, starting time
MyTimer()
default constructor
std::string name
first implementation, only one name,
double GetTotalTime(std::string str_name=std::string())
Get the total time, anonymous or named.
MyTimer can register call(s) and print reports.
void Stop()
Stop the timer.
unsigned int GetNumberCalls()
Get the number of calls.
std::string GetName()
Get the timer name.
void Start()
Start the timer.
virtual ~MyTimer()
virtual destructor, class could be derived
std::chrono::duration< double, std::milli > duration_dtt
duration_dtt total_t
total time, a duration
nested class of MyTimer, contains the timers functions
std::chrono::time_point< std::chrono::steady_clock, std::chrono::duration< double, std::ratio< 1, 1000000000 > > > tpoint
void Reset()
reset the timer
void Start()
Start the timer.
double GetAverageTime(std::string str_name=std::string())
Get the average time, total time / number of calls.
virtual void Report()
Make a report for the timers.