CMS 3D CMS Logo

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

#include <TimingReport.h>

Public Member Functions

bool active () const
 
double cpusec () const
 
 Item ()
 
double realsec () const
 
double realticks () const
 
void setObs (MyObserver *io)
 
void start ()
 
void stop ()
 
ItemswitchCPU (bool ion)
 
ItemswitchOn (bool ion)
 

Public Attributes

int counter
 
bool cpuon
 
LinuxCPUTimer cpuwatch
 
MyObservero
 
bool on
 
PentiumTimer stopwatch
 

Private Types

typedef BaseEvent< std::pair
< double, double > > 
MyObserver
 

Detailed Description

Definition at line 26 of file TimingReport.h.

Member Typedef Documentation

typedef BaseEvent< std::pair<double,double> > TimingReport::Item::MyObserver
private

Definition at line 27 of file TimingReport.h.

Constructor & Destructor Documentation

TimingReport::Item::Item ( )
inline

Definition at line 29 of file TimingReport.h.

29 : on(true), cpuon(true), counter(0), o(0){}
MyObserver * o
Definition: TimingReport.h:54

Member Function Documentation

bool TimingReport::Item::active ( void  ) const
inline

Definition at line 43 of file TimingReport.h.

References GenTimer< Time >::running(), and stopwatch.

Referenced by stop().

43 { return stopwatch.running();}
PentiumTimer stopwatch
Definition: TimingReport.h:52
bool running() const
Definition: GenTimer.h:95
double TimingReport::Item::cpusec ( ) const

Definition at line 16 of file TimingReport.cc.

References GenTimer< LCPUTime >::bias(), GenTimer< PentiumTime >::bias(), counter, and bookConverter::max.

16  {
18 }
LinuxCPUTimer cpuwatch
Definition: TimingReport.h:53
static double bias(bool insec=true, unsigned int n=5000)
Definition: GenTimer.h:77
double seconds() const
Definition: GenTimer.h:33
Time::TimeInterval lap() const
Definition: GenTimer.h:122
double TimingReport::Item::realsec ( ) const

Definition at line 8 of file TimingReport.cc.

References GenTimer< PentiumTime >::bias(), counter, GenTimer< Time >::lap(), bookConverter::max, GenTimeInterval< Time >::seconds(), and stopwatch.

8  {
10 }
static double bias(bool insec=true, unsigned int n=5000)
Definition: GenTimer.h:77
PentiumTimer stopwatch
Definition: TimingReport.h:52
double seconds() const
Definition: GenTimer.h:33
Time::TimeInterval lap() const
Definition: GenTimer.h:122
double TimingReport::Item::realticks ( ) const

Definition at line 12 of file TimingReport.cc.

References GenTimer< PentiumTime >::bias(), counter, and bookConverter::max.

12  {
13  return std::max(0.,stopwatch.lap().ticks()-counter*PentiumTimer::bias(false));
14 }
static double bias(bool insec=true, unsigned int n=5000)
Definition: GenTimer.h:77
PentiumTimer stopwatch
Definition: TimingReport.h:52
Time::TimeInterval lap() const
Definition: GenTimer.h:122
const IntervalType & ticks() const
Definition: GenTimer.h:30
void TimingReport::Item::setObs ( MyObserver io)
inline

Definition at line 44 of file TimingReport.h.

References o.

Referenced by R2DTimerObserver::init().

44 { o=io;}
MyObserver * o
Definition: TimingReport.h:54
void TimingReport::Item::start ( void  )
inline

Definition at line 32 of file TimingReport.h.

References counter, cpuon, cpuwatch, on, GenTimer< Time >::start(), and stopwatch.

Referenced by R2DTimerObserver::start(), and TimeMe::TimeMe().

32 { if (on) {counter++; if (cpuon) cpuwatch.start(); stopwatch.start(); }}
LinuxCPUTimer cpuwatch
Definition: TimingReport.h:53
PentiumTimer stopwatch
Definition: TimingReport.h:52
void start()
Definition: GenTimer.h:104
void TimingReport::Item::stop ( )
inline

Definition at line 33 of file TimingReport.h.

References active(), cpuon, cpuwatch, GenTimer< Time >::lap(), o, on, GenTimeInterval< Time >::seconds(), GenTimer< Time >::stop(), and stopwatch.

Referenced by R2DTimerObserver::stop(), and TimeMe::~TimeMe().

33  {
34  if (on) {
35  stopwatch.stop();
36  if (cpuon) cpuwatch.stop();
37  if (active()) return;
38  if (o) (*o)(std::pair<double,double>(stopwatch.lap().seconds(),
39  cpuwatch.lap().seconds()));
40  }
41  }
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
bool active() const
Definition: TimingReport.h:43
void stop()
Definition: GenTimer.h:110
MyObserver * o
Definition: TimingReport.h:54
Item& TimingReport::Item::switchCPU ( bool  ion)
inline

Definition at line 31 of file TimingReport.h.

References cpuon.

Referenced by R2DTimerObserver::init(), and TimeMe::TimeMe().

31 {cpuon=ion; return *this;}
Item& TimingReport::Item::switchOn ( bool  ion)
inline

Definition at line 30 of file TimingReport.h.

References on.

30 {on=ion; return *this;}

Member Data Documentation

int TimingReport::Item::counter

Definition at line 51 of file TimingReport.h.

Referenced by TimerStack::push(), realsec(), and start().

bool TimingReport::Item::cpuon

Definition at line 50 of file TimingReport.h.

Referenced by start(), stop(), and switchCPU().

LinuxCPUTimer TimingReport::Item::cpuwatch

Definition at line 53 of file TimingReport.h.

Referenced by TimeMe::lap(), start(), and stop().

MyObserver* TimingReport::Item::o

Definition at line 54 of file TimingReport.h.

Referenced by setObs(), and stop().

bool TimingReport::Item::on

Definition at line 49 of file TimingReport.h.

Referenced by start(), stop(), and switchOn().

PentiumTimer TimingReport::Item::stopwatch

Definition at line 52 of file TimingReport.h.

Referenced by active(), TimeMe::lap(), realsec(), start(), and stop().