Class MHO_Timer - A timer class responsible for thread and process benchmarking For more information on the linux system variables and functions that were leveraged see: https://linux.die.net/man/3/clock_gettime TODO – detect if system actually has a realtime clock and disable if not present.
More...
#include <MHO_Timer.hh>
Class MHO_Timer - A timer class responsible for thread and process benchmarking For more information on the linux system variables and functions that were leveraged see: https://linux.die.net/man/3/clock_gettime TODO – detect if system actually has a realtime clock and disable if not present.
- Author
- J. Barrett - barre.nosp@m.ttj@.nosp@m.mit.e.nosp@m.du
◆ MHO_Timer() [1/2]
hops::MHO_Timer::MHO_Timer |
( |
| ) |
|
◆ MHO_Timer() [2/2]
hops::MHO_Timer::MHO_Timer |
( |
std::string |
name | ) |
|
◆ ~MHO_Timer()
hops::MHO_Timer::~MHO_Timer |
( |
| ) |
|
|
virtual |
◆ GetDurationAsDouble()
double hops::MHO_Timer::GetDurationAsDouble |
( |
| ) |
const |
- Call GetTimeDifference and return the result as a double
- Parameters
-
- Returns
- ret_val double which contains the start and stop time in seconds
◆ GetDurationAsTimeSpec()
timespec hops::MHO_Timer::GetDurationAsTimeSpec |
( |
| ) |
const |
- Call GetTimeDifference and return the result as a timespec struct
- Parameters
-
- Returns
- ret_val timespec which is a struct containing the start and stop time in seconds and nanoseconds as two seperate values
◆ GetName()
std::string hops::MHO_Timer::GetName |
( |
| ) |
const |
|
inline |
- Get the timer name
- Parameters
-
- Returns
- fName string timer name
◆ GetTimeDifference()
timespec hops::MHO_Timer::GetTimeDifference |
( |
const timespec & |
start, |
|
|
const timespec & |
stop |
|
) |
| const |
|
protected |
- Calculate total compute time spent on a process or thread and store the result in a timespec struct
- Parameters
-
start | timespec which is the start time for a process or thread |
stop | timespec which is the start time for a process or thread |
- Returns
- ret_val timespec which contains the time spent on a given process or thread in seconds and nanoseconds
◆ GetTimeSinceStart()
double hops::MHO_Timer::GetTimeSinceStart |
( |
| ) |
const |
◆ MeasureProcessTime()
void hops::MHO_Timer::MeasureProcessTime |
( |
| ) |
|
- Get the ID for the process clock
- Parameters
-
- Returns
- None
◆ MeasureThreadTime()
void hops::MHO_Timer::MeasureThreadTime |
( |
| ) |
|
- Get the ID for the thread clock which indicates the time used by all threads in the process
- Parameters
-
- Returns
- None
◆ MeasureWallclockTime()
void hops::MHO_Timer::MeasureWallclockTime |
( |
| ) |
|
- Set the timer's clock ID to that of the linux system wide realtime clock
- Parameters
-
- Returns
- None
◆ SetName()
void hops::MHO_Timer::SetName |
( |
std::string |
name | ) |
|
|
inline |
Set the timer name
- Parameters
-
- Returns
- None
◆ Start()
void hops::MHO_Timer::Start |
( |
| ) |
|
- Store the current linux system time as the start time of a timer in a timespec struct
- Parameters
-
- Returns
- None
◆ Stop()
void hops::MHO_Timer::Stop |
( |
| ) |
|
- Store the current linux system time as the stop time of a timer in a timespec struct
- Parameters
-
- Returns
- None
◆ fClockID
clockid_t hops::MHO_Timer::fClockID |
|
protected |
◆ fName
std::string hops::MHO_Timer::fName |
|
protected |
◆ fStart
timespec hops::MHO_Timer::fStart |
|
protected |
◆ fStop
timespec hops::MHO_Timer::fStop |
|
protected |
The documentation for this class was generated from the following files: