CombineHarvester
ch::FnTimer Class Reference

Determine the total amount of time spent in a function. More...

#include "/afs/cern.ch/user/a/agilbert/CMSSW_14_1_0_pre4/src/CombineHarvester/CombineTools/interface/Logging.h"

Data Structures

class  Token
 

Public Member Functions

 FnTimer (std::string name)
 
 ~FnTimer ()
 
Token Inc ()
 
void StartTimer ()
 
void StopTimer ()
 

Detailed Description

Determine the total amount of time spent in a function.

An FnTimer instance should typically be declared as a static variable at the beginning of a function, follwed by a call to the Inc() method, which will increment the counter. The Inc() method also returns an FnTimer::Token object that records the time at which it is constructed and then destroyed, the latter occurring automatically at the end of the function. At the end of the program the FnTimer destructor will write a message to the screen summarising the number of calls and the time information.

Note
A simple way of using this class is via the LAUNCH_FUNCTION_TIMER(x,y) macro

Definition at line 85 of file Logging.h.

Constructor & Destructor Documentation

◆ FnTimer()

ch::FnTimer::FnTimer ( std::string  name)
explicit

Definition at line 49 of file Logging.cc.

◆ ~FnTimer()

ch::FnTimer::~FnTimer ( )

Definition at line 50 of file Logging.cc.

Member Function Documentation

◆ Inc()

FnTimer::Token ch::FnTimer::Inc ( )

Definition at line 55 of file Logging.cc.

◆ StartTimer()

void ch::FnTimer::StartTimer ( )

Definition at line 59 of file Logging.cc.

◆ StopTimer()

void ch::FnTimer::StopTimer ( )

Definition at line 60 of file Logging.cc.


The documentation for this class was generated from the following files: