CMS 3D CMS Logo

Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes

GenTimer< Time > Class Template Reference

#include <GenTimer.h>

List of all members.

Classes

struct  Bias

Public Types

typedef Time::IntervalType IntervalType
typedef GenTimer< Time > self
typedef Time::TimeInterval TimeInterval

Public Member Functions

void forceStop ()
 GenTimer ()
 constructor
 GenTimer (int ipid)
 from known context
Time::TimeInterval lap () const
void reset ()
bool running () const
void start ()
void stop ()
 ~GenTimer ()
 destructor

Static Public Member Functions

static double bias (bool insec=true, unsigned int n=5000)
static double ticksInSec ()

Private Attributes

Time::IntervalType elapsed
int pid
int running_

Detailed Description

template<class Time>
class GenTimer< Time >

a templated generic timer

Definition at line 51 of file GenTimer.h.


Member Typedef Documentation

template<class Time>
typedef Time::IntervalType GenTimer< Time >::IntervalType

Definition at line 54 of file GenTimer.h.

template<class Time>
typedef GenTimer<Time> GenTimer< Time >::self

Definition at line 56 of file GenTimer.h.

template<class Time>
typedef Time::TimeInterval GenTimer< Time >::TimeInterval

Definition at line 53 of file GenTimer.h.


Constructor & Destructor Documentation

template<class Time>
GenTimer< Time >::GenTimer ( ) [inline]

constructor

Definition at line 87 of file GenTimer.h.

: elapsed(0),  running_(0), pid(0) {}
template<class Time>
GenTimer< Time >::GenTimer ( int  ipid) [inline]

from known context

Definition at line 89 of file GenTimer.h.

: elapsed(0),  running_(0), pid(ipid) {}
template<class Time>
GenTimer< Time >::~GenTimer ( ) [inline]

destructor

Definition at line 92 of file GenTimer.h.

{}

Member Function Documentation

template<class Time>
static double GenTimer< Time >::bias ( bool  insec = true,
unsigned int  n = 5000 
) [inline, static]

Definition at line 77 of file GenTimer.h.

                                                           {
    static Bias it(n);
    return insec ? it.mes : double(it.met) ;
  }
template<class Time>
void GenTimer< Time >::forceStop ( ) [inline]

Definition at line 115 of file GenTimer.h.

                          {
    if (running_==0) return;
    running_ =1;
    stop();
  }
template<class Time>
Time::TimeInterval GenTimer< Time >::lap ( ) const [inline]
template<class Time>
void GenTimer< Time >::reset ( void  ) [inline]

Definition at line 98 of file GenTimer.h.

                      { 
    if (running()) elapsed=-Time::time(pid);
    else elapsed=0;
  }
template<class Time>
bool GenTimer< Time >::running ( ) const [inline]
template<class Time>
void GenTimer< Time >::start ( void  ) [inline]

Definition at line 104 of file GenTimer.h.

Referenced by GenTimer< Time >::Bias::Bias(), and TimingReport::Item::start().

                      {
    running_++;
    if (running_==1) elapsed-=Time::time(pid);
  }
template<class Time>
void GenTimer< Time >::stop ( ) [inline]
template<class Time>
static double GenTimer< Time >::ticksInSec ( ) [inline, static]

Definition at line 83 of file GenTimer.h.

{ return Time::oneTick();}

Member Data Documentation

template<class Time>
Time::IntervalType GenTimer< Time >::elapsed [private]
template<class Time>
int GenTimer< Time >::pid [private]
template<class Time>
int GenTimer< Time >::running_ [private]