Class Reference for E1039 Core & Analysis Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PHTimer Class Reference

high precision timer More...

#include </dev/shm/kenichi/update-github-e1039-doc/e1039-core/framework/phool/PHTimer.h>

Public Types

enum  State { STOP =0, RUN =1 }
 enum for timer state More...
 

Public Member Functions

State get_state (void) const
 access timer state More...
 
 PHTimer (const std::string &name="Generic Timer")
 Construct with a name. More...
 
void reset ()
 
void stop ()
 stops the counter More...
 
void restart ()
 Restart timer. More...
 
void print (std::ostream &os=std::cout) const
 Dump elapsed time to provided ostream. More...
 
void print_stat (std::ostream &os=std::cout) const
 Dump statistics. More...
 
void set_name (const std::string &name)
 Set timer name. More...
 
std::string get_name (void) const
 get timer name More...
 
double get_accumulated_time (void) const
 get cumulated time More...
 
unsigned int get_ncycle (void) const
 get number of cycles More...
 
double get_time_per_cycle (void) const
 get averaged time/cycle More...
 
double elapsed (void) const
 retrieve elapsed value since last restart (in ms) More...
 
void test (double time, std::ostream &os=std::cout)
 test PHTimer for a given amount of time (in ms) More...
 

Static Public Member Functions

static void PRINT (std::ostream &os=std::cout, const std::string &message="")
 print a message (formated) to a stream More...
 

Detailed Description

high precision timer

high precision timer

Definition at line 24 of file PHTimer.h.

Member Enumeration Documentation

enum for timer state

Enumerator
STOP 
RUN 

Definition at line 29 of file PHTimer.h.

Constructor & Destructor Documentation

PHTimer::PHTimer ( const std::string &  name = "Generic Timer")
inline

Construct with a name.

Definition at line 40 of file PHTimer.h.

Member Function Documentation

double PHTimer::elapsed ( void  ) const
inline

retrieve elapsed value since last restart (in ms)

Definition at line 116 of file PHTimer.h.

References RUN.

Referenced by print(), and stop().

+ Here is the caller graph for this function:

double PHTimer::get_accumulated_time ( void  ) const
inline

get cumulated time

Definition at line 104 of file PHTimer.h.

std::string PHTimer::get_name ( void  ) const
inline

get timer name

Definition at line 100 of file PHTimer.h.

unsigned int PHTimer::get_ncycle ( void  ) const
inline

get number of cycles

Definition at line 108 of file PHTimer.h.

State PHTimer::get_state ( void  ) const
inline

access timer state

Definition at line 36 of file PHTimer.h.

double PHTimer::get_time_per_cycle ( void  ) const
inline

get averaged time/cycle

Definition at line 112 of file PHTimer.h.

void PHTimer::print ( std::ostream &  os = std::cout) const
inline

Dump elapsed time to provided ostream.

Definition at line 73 of file PHTimer.h.

References elapsed(), and PRINT().

Referenced by test().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void PHTimer::PRINT ( std::ostream &  os = std::cout,
const std::string &  message = "" 
)
static

print a message (formated) to a stream

Definition at line 75 of file PHTimer.cc.

Referenced by print(), PHTimeServer::print(), print_stat(), PHTimeServer::print_stat(), and test().

+ Here is the caller graph for this function:

void PHTimer::print_stat ( std::ostream &  os = std::cout) const
inline

Dump statistics.

Definition at line 82 of file PHTimer.h.

References PRINT().

+ Here is the call graph for this function:

void PHTimer::reset ( )
inline

Definition at line 51 of file PHTimer.h.

References STOP.

void PHTimer::restart ( )
inline

Restart timer.

Definition at line 70 of file PHTimer.h.

References RUN.

Referenced by PHG4PhenixEventAction::BeginOfEventAction(), PHG4BlockCellReco::process_event(), PHG4CylinderCellReco::process_event(), PHG4CylinderCellTPCReco::process_event(), PHG4Reco::process_event(), and test().

+ Here is the caller graph for this function:

void PHTimer::set_name ( const std::string &  name)
inline

Set timer name.

Definition at line 96 of file PHTimer.h.

void PHTimer::stop ( )
inline

stops the counter

Definition at line 61 of file PHTimer.h.

References elapsed(), and STOP.

Referenced by PHG4PhenixEventAction::EndOfEventAction(), PHG4BlockCellReco::process_event(), PHG4CylinderCellReco::process_event(), PHG4CylinderCellTPCReco::process_event(), and PHG4Reco::process_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void PHTimer::test ( double  time,
std::ostream &  os = std::cout 
)
inline

test PHTimer for a given amount of time (in ms)

Definition at line 124 of file PHTimer.h.

References print(), PRINT(), and restart().

+ Here is the call graph for this function:


The documentation for this class was generated from the following files: