CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
TimeMe Class Reference

#include <TimingReport.h>

Public Member Functions

std::pair< double, double > lap () const
 
 TimeMe (const std::string &name, bool cpu=true)
 
 TimeMe (TimingReport::Item &iitem, bool cpu=true)
 
 ~TimeMe ()
 

Private Attributes

TimingReport::Itemitem
 

Detailed Description

a class to time a "scope" to be used as a "Sentry".

Just create a TimeMe object giving it a name; exiting the scope the object will be deleted; the constuctor starts the timing. the destructor stops it.

Definition at line 124 of file TimingReport.h.

Constructor & Destructor Documentation

TimeMe::TimeMe ( const std::string &  name,
bool  cpu = true 
)
inlineexplicit

Definition at line 128 of file TimingReport.h.

References evf::utils::cpu, item, TimingReport::Item::start(), and TimingReport::Item::switchCPU().

128  :
130  item.switchCPU(cpu);
131  item.start();
132  }
static TimingReport * current()
Definition: TimingReport.cc:21
TimingReport::Item & item
Definition: TimingReport.h:152
Item & switchCPU(bool ion)
Definition: TimingReport.h:31
TimeMe::TimeMe ( TimingReport::Item iitem,
bool  cpu = true 
)
inlineexplicit

Definition at line 134 of file TimingReport.h.

References evf::utils::cpu, item, TimingReport::Item::start(), and TimingReport::Item::switchCPU().

134  :
135  item(iitem) {
136  item.switchCPU(cpu);
137  item.start();
138  }
TimingReport::Item & item
Definition: TimingReport.h:152
Item & switchCPU(bool ion)
Definition: TimingReport.h:31
TimeMe::~TimeMe ( )
inline

Definition at line 146 of file TimingReport.h.

References item, and TimingReport::Item::stop().

146  {
147  item.stop();
148  }
TimingReport::Item & item
Definition: TimingReport.h:152

Member Function Documentation

std::pair<double,double> TimeMe::lap ( ) const
inline

Definition at line 140 of file TimingReport.h.

References TimingReport::Item::cpuwatch, item, GenTimer< Time >::lap(), GenTimeInterval< Time >::seconds(), and TimingReport::Item::stopwatch.

140  {
141  return std::pair<double,double>(item.stopwatch.lap().seconds(),
142  item.cpuwatch.lap().seconds());
143  }
LinuxCPUTimer cpuwatch
Definition: TimingReport.h:53
PentiumTimer stopwatch
Definition: TimingReport.h:52
double seconds() const
Definition: GenTimer.h:33
Time::TimeInterval lap() const
Definition: GenTimer.h:122
TimingReport::Item & item
Definition: TimingReport.h:152

Member Data Documentation

TimingReport::Item& TimeMe::item
private