CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
trklet::Timer Class Reference

#include <Timer.h>

Public Member Functions

double avgtime () const
 
unsigned int ntimes () const
 
double rms () const
 
void start ()
 
void stop ()
 
 Timer ()
 
double tottime () const
 
 ~Timer ()=default
 

Private Attributes

unsigned int ntimes_ {0}
 
std::chrono::high_resolution_clock::time_point tstart_
 
double ttot_ {0.0}
 
double ttotsq_ {0.0}
 

Detailed Description

Definition at line 9 of file Timer.h.

Constructor & Destructor Documentation

◆ Timer()

trklet::Timer::Timer ( )
inline

Definition at line 11 of file Timer.h.

11 {}

◆ ~Timer()

trklet::Timer::~Timer ( )
default

Member Function Documentation

◆ avgtime()

double trklet::Timer::avgtime ( ) const
inline

Definition at line 18 of file Timer.h.

18 { return ttot_ / ntimes_; }

References ntimes_, and ttot_.

Referenced by trklet::TrackletEventProcessor::printSummary().

◆ ntimes()

unsigned int trklet::Timer::ntimes ( ) const
inline

Definition at line 17 of file Timer.h.

17 { return ntimes_; }

References ntimes_.

Referenced by trklet::TrackletEventProcessor::printSummary().

◆ rms()

double trklet::Timer::rms ( ) const
inline

Definition at line 19 of file Timer.h.

19 { return sqrt((ttot_ * ttot_ - ttotsq_)) / ntimes_; }

References ntimes_, mathSSE::sqrt(), ttot_, and ttotsq_.

◆ start()

void Timer::start ( )

◆ stop()

void Timer::stop ( )

Definition at line 6 of file Timer.cc.

6  {
8  double tmp = std::chrono::duration<double>(tstop - tstart_).count();
9  ttot_ += tmp;
10  ttotsq_ += tmp * tmp;
11  ntimes_++;
12 }

References fileCollector::now, ntimes_, createJobs::tmp, tstart_, ttot_, and ttotsq_.

Referenced by trklet::TrackletEventProcessor::event().

◆ tottime()

double trklet::Timer::tottime ( ) const
inline

Definition at line 20 of file Timer.h.

20 { return ttot_; }

References ttot_.

Referenced by trklet::TrackletEventProcessor::printSummary().

Member Data Documentation

◆ ntimes_

unsigned int trklet::Timer::ntimes_ {0}
private

Definition at line 23 of file Timer.h.

Referenced by avgtime(), ntimes(), rms(), and stop().

◆ tstart_

std::chrono::high_resolution_clock::time_point trklet::Timer::tstart_
private

Definition at line 27 of file Timer.h.

Referenced by start(), and stop().

◆ ttot_

double trklet::Timer::ttot_ {0.0}
private

Definition at line 24 of file Timer.h.

Referenced by avgtime(), rms(), stop(), and tottime().

◆ ttotsq_

double trklet::Timer::ttotsq_ {0.0}
private

Definition at line 25 of file Timer.h.

Referenced by rms(), and stop().

trklet::Timer::tstart_
std::chrono::high_resolution_clock::time_point tstart_
Definition: Timer.h:27
trklet::Timer::ttotsq_
double ttotsq_
Definition: Timer.h:25
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
fileCollector.now
now
Definition: fileCollector.py:207
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
trklet::Timer::ttot_
double ttot_
Definition: Timer.h:24
trklet::Timer::ntimes_
unsigned int ntimes_
Definition: Timer.h:23