CMS 3D CMS Logo

Public Member Functions | Public Attributes | Private Attributes | Static Private Attributes

TimerService Class Reference

#include <TimerService.h>

List of all members.

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::CPUTimercpu_timer = 0

Detailed Description

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.


Constructor & Destructor Documentation

TimerService::TimerService ( const edm::ParameterSet ps,
edm::ActivityRegistry iAR 
) [explicit]
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;
  }
}

Member Function Documentation

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().


Member Data Documentation

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().