BOSS 7.0.6
BESIII Offline Software System
Loading...
Searching...
No Matches
Clock Class Reference

#include <Clock.h>

Public Member Functions

 Clock ()
 
virtual ClockWord count (double t)
 
virtual ClockWord count (unsigned int c)
 
virtual void reset ()
 
double freq () const
 
virtual unsigned int cycles ()
 
virtual double elapsed ()
 

Detailed Description

Definition at line 24 of file Clock.h.

Constructor & Destructor Documentation

◆ Clock()

Clock::Clock ( )
inline

Definition at line 27 of file Clock.h.

28 : m_time(0), m_freq(2.E7)
29 {}

Member Function Documentation

◆ count() [1/2]

virtual ClockWord Clock::count ( double  t)
inlinevirtual

Definition at line 31 of file Clock.h.

32 {
33 m_time += t;
34 return m_time;
35 }
TTree * t
Definition: binning.cxx:23

◆ count() [2/2]

virtual ClockWord Clock::count ( unsigned int  c)
inlinevirtual

Definition at line 37 of file Clock.h.

38 {
39 m_time += c * 1./m_freq;
40 return m_time;
41 }

◆ cycles()

virtual unsigned int Clock::cycles ( )
inlinevirtual

Definition at line 53 of file Clock.h.

54 {
55 return static_cast<unsigned>(ceil(m_time / m_freq));
56 }

◆ elapsed()

virtual double Clock::elapsed ( )
inlinevirtual

Definition at line 58 of file Clock.h.

59 {
60 return m_time;
61 }

◆ freq()

double Clock::freq ( ) const
inline

Definition at line 48 of file Clock.h.

49 {
50 return m_freq;
51 }

◆ reset()

virtual void Clock::reset ( )
inlinevirtual

Definition at line 43 of file Clock.h.

44 {
45 m_time = 0;
46 }

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