NAGASH 0.9.8
Next Generation Analysis System
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Public Member Functions | Private Attributes | List of all members
NAGASH::Timer Class Reference

calculate the time interval between two time stamps. More...

#include "NAGASH/Timer.h"

Inheritance diagram for NAGASH::Timer:
NAGASH::Tool

Public Member Functions

 Timer (std::shared_ptr< MSGTool > msg, const TString &name="Timer")
 Constructor.
 
void Clear ()
 Clear all the time stamps.
 
void Duration (const TString &Name1, const TString &Name2)
 Print the time interval between two time stamps.
 
void PrintCurrent (const TString &prefix="")
 Print the current time.
 
void Record (const TString &Name)
 Record the current time.
 

Private Attributes

std::map< TString, int > TimeIndexMap
 
std::vector< std::chrono::time_point< std::chrono::system_clock > > TimeRecord
 
std::vector< TString > TimeRecordName
 
TString TimerName
 

Additional Inherited Members

- Protected Member Functions inherited from NAGASH::Tool
 Tool ()=delete
 
 Tool (const Tool &tool)=delete
 
 Tool (std::shared_ptr< MSGTool > MSG)
 Constructor.
 
 Tool (Tool &&tool)=delete
 
virtual ~Tool ()=default
 
std::shared_ptr< MSGToolMSGUser ()
 return the MSGTool inside.
 
Tooloperator= (const Tool &tool)=delete
 
Tooloperator= (Tool &&tool)=delete
 

Detailed Description

calculate the time interval between two time stamps.

Definition at line 13 of file Timer.h.

Constructor & Destructor Documentation

◆ Timer()

NAGASH::Timer::Timer ( std::shared_ptr< MSGTool msg,
const TString &  name = "Timer" 
)
inline

Constructor.

Parameters
msginput MSGTool.
namename of the timer.

Definition at line 19 of file Timer.h.

Member Function Documentation

◆ Clear()

void Timer::Clear ( )

Clear all the time stamps.

Definition at line 101 of file Timer.cxx.

◆ Duration()

void Timer::Duration ( const TString &  Name1,
const TString &  Name2 
)

Print the time interval between two time stamps.

Parameters
Name1name of the first time stamp.
Name2name of the second time stamp.

Definition at line 46 of file Timer.cxx.

◆ PrintCurrent()

void Timer::PrintCurrent ( const TString &  prefix = "")

Print the current time.

Parameters
prefixsome message you want to print before the current time.

Definition at line 18 of file Timer.cxx.

◆ Record()

void Timer::Record ( const TString &  Name)

Record the current time.

Parameters
Namename of the time stamp.

Definition at line 28 of file Timer.cxx.

Member Data Documentation

◆ TimeIndexMap

std::map<TString, int> NAGASH::Timer::TimeIndexMap
private

Definition at line 27 of file Timer.h.

◆ TimeRecord

std::vector<std::chrono::time_point<std::chrono::system_clock> > NAGASH::Timer::TimeRecord
private

Definition at line 26 of file Timer.h.

◆ TimeRecordName

std::vector<TString> NAGASH::Timer::TimeRecordName
private

Definition at line 28 of file Timer.h.

◆ TimerName

TString NAGASH::Timer::TimerName
private

Definition at line 29 of file Timer.h.


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