CMS 3D CMS Logo

TimeMe Class Reference

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

#include <Utilities/Timing/interface/TimingReport.h>

List of all members.

Public Member Functions

std::pair< double, double > lap () const
 TimeMe (TimingReport::Item &iitem, bool cpu=true)
 TimeMe (const std::string &name, 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 
) [inline, explicit]

Definition at line 128 of file TimingReport.h.

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

00128                                                         :
00129     item((*TimingReport::current())[name]) {
00130     item.switchCPU(cpu);
00131     item.start();
00132   }

TimeMe::TimeMe ( TimingReport::Item iitem,
bool  cpu = true 
) [inline, explicit]

Definition at line 134 of file TimingReport.h.

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

00134                                                            :
00135     item(iitem) {
00136     item.switchCPU(cpu);
00137     item.start();
00138   }

TimeMe::~TimeMe (  )  [inline]

Definition at line 146 of file TimingReport.h.

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

00146             {
00147     item.stop();
00148   }


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(), and TimingReport::Item::stopwatch.

00140                                      { 
00141     return std::pair<double,double>(item.stopwatch.lap().seconds(),
00142                                item.cpuwatch.lap().seconds());
00143   }


Member Data Documentation

TimingReport::Item& TimeMe::item [private]

Definition at line 152 of file TimingReport.h.

Referenced by lap(), TimeMe(), and ~TimeMe().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:33:28 2009 for CMSSW by  doxygen 1.5.4