#include <R2DTimerObserver.h>
Classes | |
class | LastMeasurement |
Public Member Functions | |
void | init (const std::string &name) |
TimingReport::Item & | item () |
const LastMeasurement & | lastMeasurement () |
R2DTimerObserver () | |
R2DTimerObserver (const std::string name) | |
void | start () |
void | stop () |
Private Types | |
typedef TimingReport::ItemObserver::event | TimerState |
Private Member Functions | |
virtual void | operator() (const TimerState &timerState) |
from base class | |
Private Attributes | |
TimerState | lastState |
LastMeasurement | theMeasurement |
TimingReport::Item * | timer_item |
utility to get the real/cpu time betwen last TimingReport::Item start-stop. actual timer initialisation by initTiming(..) from PixelRecoUtilities. example usage: R2DTimerObserver tm("timer name"); .... { TimeMe t(tm.item(),false); ... } last_real = tm.lastMeasurement().real();
Definition at line 7 of file R2DTimerObserver.h.
typedef TimingReport::ItemObserver::event R2DTimerObserver::TimerState [private] |
Definition at line 19 of file R2DTimerObserver.h.
R2DTimerObserver::R2DTimerObserver | ( | ) | [inline] |
Definition at line 49 of file R2DTimerObserver.h.
: timer_item(0), lastState(0,0) { }
R2DTimerObserver::R2DTimerObserver | ( | const std::string | name | ) | [inline] |
void R2DTimerObserver::init | ( | const std::string & | name | ) | [inline] |
Definition at line 43 of file R2DTimerObserver.h.
References cond::rpcobimon::current, TimingReport::Item::setObs(), TimingReport::Item::switchCPU(), and timer_item.
Referenced by R2DTimerObserver().
{ timer_item = &(*TimingReport::current())[name]; timer_item->switchCPU(false); timer_item->setObs(this); }
TimingReport::Item& R2DTimerObserver::item | ( | ) | [inline] |
const LastMeasurement& R2DTimerObserver::lastMeasurement | ( | ) | [inline] |
Definition at line 52 of file R2DTimerObserver.h.
References theMeasurement.
Referenced by SiPixelDigiToRaw::produce(), and SiPixelRawToDigi::produce().
{ return theMeasurement; }
virtual void R2DTimerObserver::operator() | ( | const TimerState & | timerState | ) | [inline, private, virtual] |
from base class
Implements BaseEvent< T >.
Definition at line 35 of file R2DTimerObserver.h.
References lastState, and theMeasurement.
{ theMeasurement = LastMeasurement(timerState.first-lastState.first, timerState.second-lastState.second); lastState = timerState; }
void R2DTimerObserver::start | ( | void | ) | [inline] |
Definition at line 55 of file R2DTimerObserver.h.
References TimingReport::Item::start(), and timer_item.
Referenced by SiPixelDigiToRaw::produce(), and SiPixelRawToDigi::produce().
{ timer_item->start(); }
void R2DTimerObserver::stop | ( | ) | [inline] |
Definition at line 56 of file R2DTimerObserver.h.
References TimingReport::Item::stop(), and timer_item.
Referenced by SiPixelDigiToRaw::produce(), and SiPixelRawToDigi::produce().
{ timer_item->stop(); }
TimerState R2DTimerObserver::lastState [private] |
Definition at line 31 of file R2DTimerObserver.h.
Referenced by operator()().
Definition at line 32 of file R2DTimerObserver.h.
Referenced by lastMeasurement(), and operator()().
TimingReport::Item* R2DTimerObserver::timer_item [private] |