ROOT_Application
2.0
C++ Core modules and GUIStock
|
MyTimer can register call(s) and print reports. More...
#include <MyTimer.h>
Data Structures | |
class | OneTimer |
nested class of MyTimer, contains the timers functions More... | |
Public Member Functions | |
virtual void | Report () |
Make a report for the timers. More... | |
Contructor | |
MyTimer () | |
default constructor More... | |
MyTimer (std::string str_name) | |
constructor with a timer name More... | |
virtual | ~MyTimer () |
virtual destructor, class could be derived More... | |
Getter/Setter | |
std::string | GetName () |
Get the timer name. More... | |
Get times | |
double | GetTotalTime (std::string str_name=std::string()) |
Get the total time, anonymous or named. More... | |
double | GetAverageTime (std::string str_name=std::string()) |
Get the average time, total time / number of calls. More... | |
unsigned int | GetNumberCalls (std::string str_name=std::string("default_timer")) |
Get the number of calls (used for average) More... | |
Starting and Stopping the timer | |
void | Start () |
Start the timer. More... | |
void | Stop () |
Stop the timer. More... | |
void | Reset (std::string str_name=std::string("default_timer")) |
Reset the timer. More... | |
Private Attributes | |
std::string | name |
first implementation, only one name, More... | |
OneTimer | one_timer |
MyTimer::MyTimer | ( | ) |
MyTimer::MyTimer | ( | std::string | str_name | ) |
constructor with a timer name
Definition at line 27 of file MyTimer.cpp.
|
virtual |
virtual destructor, class could be derived
Definition at line 36 of file MyTimer.cpp.
double MyTimer::GetAverageTime | ( | std::string | str_name = std::string() | ) |
Get the average time, total
time / number of calls.
Definition at line 72 of file MyTimer.cpp.
References MyTimer::OneTimer::GetAllTimes(), and one_timer.
|
inline |
unsigned int MyTimer::GetNumberCalls | ( | std::string | str_name = std::string("default_timer") | ) |
Get the number of calls (used for average)
Definition at line 78 of file MyTimer.cpp.
References MyTimer::OneTimer::GetNumberCalls(), and one_timer.
double MyTimer::GetTotalTime | ( | std::string | str_name = std::string() | ) |
Get the total time, anonymous or named.
Definition at line 66 of file MyTimer.cpp.
References MyTimer::OneTimer::GetAllTimes(), and one_timer.
|
virtual |
Make a report for the timers.
Virtual can be overwriden
Definition at line 84 of file MyTimer.cpp.
References MyTimer::OneTimer::GetAllTimes(), MyTimer::OneTimer::GetNumberCalls(), name, and one_timer.
void MyTimer::Reset | ( | std::string | str_name = std::string("default_timer") | ) |
Reset the timer.
Definition at line 58 of file MyTimer.cpp.
References one_timer, and MyTimer::OneTimer::Reset().
void MyTimer::Start | ( | ) |
Start the timer.
Definition at line 42 of file MyTimer.cpp.
References one_timer, and MyTimer::OneTimer::Start().
void MyTimer::Stop | ( | ) |
Stop the timer.
Increment total time and number calls
Definition at line 50 of file MyTimer.cpp.
References one_timer, and MyTimer::OneTimer::Stop().
|
private |
|
private |
Definition at line 158 of file MyTimer.h.
Referenced by GetAverageTime(), GetNumberCalls(), GetTotalTime(), MyTimer(), Report(), Reset(), Start(), and Stop().