#include <TimerService.h>
Public Member Functions | |
void | postModule (const edm::ModuleDescription &iMod) |
void | preModule (const edm::ModuleDescription &iMod) |
TimerService (const edm::ParameterSet &, edm::ActivityRegistry &iAR) | |
~TimerService () | |
Public Attributes | |
sigc::signal< void, const edm::ModuleDescription &, double > | newMeasurementSignal |
Private Attributes | |
bool | useCPUtime |
Static Private Attributes | |
static edm::CPUTimer * | cpu_timer = 0 |
Description: Class accessing CPUTimer to record processing-time info per module (either CPU-time or wall-clock-time)
Original Author: Christos Leonidopoulos, March 2007
Definition at line 24 of file TimerService.h.
TimerService::TimerService | ( | const edm::ParameterSet & | ps, |
edm::ActivityRegistry & | iAR | ||
) | [explicit] |
Definition at line 6 of file TimerService.cc.
References cpu_timer, edm::ParameterSet::getUntrackedParameter(), postModule(), preModule(), useCPUtime, edm::ActivityRegistry::watchPostModule(), and edm::ActivityRegistry::watchPreModule().
{ // whether to use CPU-time (default) or wall-clock time useCPUtime = ps.getUntrackedParameter<bool>("useCPUtime", true); iAR.watchPreModule(this, &TimerService::preModule); iAR.watchPostModule(this, &TimerService::postModule); if(!cpu_timer) cpu_timer = new edm::CPUTimer(); }
TimerService::~TimerService | ( | ) |
Definition at line 20 of file TimerService.cc.
References gather_cfg::cout, cpu_timer, and useCPUtime.
{ if(cpu_timer){ using namespace std; string longLine("=========================================================="); cout << longLine << endl; cout << " TimerService Info:\n"; if(useCPUtime) cout << " Used CPU-time "; else cout << " Used wall-clock-time "; cout << "for timing information " << endl; cout << longLine << endl; delete cpu_timer; cpu_timer = 0; } }
void TimerService::postModule | ( | const edm::ModuleDescription & | iMod | ) |
Definition at line 48 of file TimerService.cc.
References cpu_timer, edm::CPUTimer::cpuTime(), newMeasurementSignal, edm::CPUTimer::realTime(), edm::CPUTimer::stop(), cond::rpcobgas::time, and useCPUtime.
Referenced by TimerService().
{ cpu_timer->stop(); double time = -999; // in secs if(useCPUtime) time = cpu_timer->cpuTime(); else time = cpu_timer->realTime(); newMeasurementSignal(iMod, time); }
void TimerService::preModule | ( | const edm::ModuleDescription & | iMod | ) |
Definition at line 41 of file TimerService.cc.
References cpu_timer, edm::CPUTimer::reset(), and edm::CPUTimer::start().
Referenced by TimerService().
edm::CPUTimer * TimerService::cpu_timer = 0 [static, private] |
Definition at line 39 of file TimerService.h.
Referenced by postModule(), preModule(), TimerService(), and ~TimerService().
sigc::signal<void, const edm::ModuleDescription&, double> TimerService::newMeasurementSignal |
Definition at line 30 of file TimerService.h.
Referenced by postModule().
bool TimerService::useCPUtime [private] |
Definition at line 41 of file TimerService.h.
Referenced by postModule(), TimerService(), and ~TimerService().