Class Reference for E1039 Core & Analysis Software
|
Class to measure the time spent by a code block. More...
#include </dev/shm/kenichi/update-github-e1039-doc/e1039-core/framework/phool/PHTimer2.h>
Public Member Functions | |
PHTimer2 (const std::string &name="Generic Timer") | |
virtual | ~PHTimer2 () |
void | set_name (const std::string &name) |
std::string | get_name () const |
double | get_accumulated_time () const |
unsigned int | get_ncycle () const |
double | get_time_per_cycle () const |
void | reset () |
void | stop () |
void | restart () |
void | reset_and_start () |
void | print_stat (std::string header=" Timer2:", std::ostream &os=std::cout) const |
void | test (unsigned int time_msec, std::ostream &os=std::cout) |
Test this class by waiting for a given time (in ms). More... | |
Protected Member Functions | |
double | elapsed () const |
In millisecond. More... | |
int | get_clock_time (timespec *tp) |
Class to measure the time spent by a code block.
It is a new (2nd) version of PHTimer
. PHTimer
was found to have two problems as of 2022-05-13:
pthread_mutex_unlock()
fails), probably because PHTimer
uses the assembly call.Definition at line 16 of file PHTimer2.h.
PHTimer2::PHTimer2 | ( | const std::string & | name = "Generic Timer" | ) |
Definition at line 7 of file PHTimer2.cc.
|
virtual |
Definition at line 16 of file PHTimer2.cc.
|
protected |
In millisecond.
Definition at line 72 of file PHTimer2.cc.
Referenced by stop().
|
inline |
Definition at line 34 of file PHTimer2.h.
Referenced by Fun4AllServer::ReadSpillTimer().
|
protected |
Definition at line 82 of file PHTimer2.cc.
Referenced by restart(), and stop().
|
inline |
Definition at line 32 of file PHTimer2.h.
|
inline |
Definition at line 35 of file PHTimer2.h.
double PHTimer2::get_time_per_cycle | ( | void | ) | const |
Definition at line 21 of file PHTimer2.cc.
Referenced by print_stat().
void PHTimer2::print_stat | ( | std::string | header = " Timer2:" , |
std::ostream & | os = std::cout |
||
) | const |
Definition at line 54 of file PHTimer2.cc.
References get_time_per_cycle().
void PHTimer2::reset | ( | ) |
Definition at line 26 of file PHTimer2.cc.
Referenced by reset_and_start(), Fun4AllServer::ResetSpillTimer(), and test().
void PHTimer2::reset_and_start | ( | ) |
Definition at line 48 of file PHTimer2.cc.
References reset(), and restart().
void PHTimer2::restart | ( | ) |
Definition at line 42 of file PHTimer2.cc.
References get_clock_time().
Referenced by Fun4AllServer::process_event(), reset_and_start(), and test().
|
inline |
Definition at line 31 of file PHTimer2.h.
void PHTimer2::stop | ( | ) |
Definition at line 33 of file PHTimer2.cc.
References elapsed(), and get_clock_time().
Referenced by Fun4AllServer::process_event(), and test().
void PHTimer2::test | ( | unsigned int | time_msec, |
std::ostream & | os = std::cout |
||
) |
Test this class by waiting for a given time (in ms).
Definition at line 62 of file PHTimer2.cc.
References reset(), restart(), and stop().