Crypto++ 8.7
Free C++ class library of cryptographic schemes
Public Member Functions | List of all members
Timer Class Reference

High resolution timer. More...

#include <hrtimer.h>

+ Inheritance diagram for Timer:

Public Member Functions

 Timer (Unit unit=TimerBase::SECONDS, bool stuckAtZero=false)
 Construct a Timer. More...
 
TimerWord GetCurrentTimerValue ()
 Retrieve the current timer value. More...
 
TimerWord TicksPerSecond ()
 Retrieve ticks per second. More...
 
- Public Member Functions inherited from TimerBase
 TimerBase (Unit unit, bool stuckAtZero)
 Construct a TimerBase. More...
 
virtual TimerWord GetCurrentTimerValue ()=0
 Retrieve the current timer value. More...
 
virtual TimerWord TicksPerSecond ()=0
 Retrieve ticks per second. More...
 
void StartTimer ()
 Start the timer.
 
double ElapsedTimeAsDouble ()
 Retrieve the elapsed time. More...
 
unsigned long ElapsedTime ()
 Retrieve the elapsed time. More...
 

Additional Inherited Members

- Public Types inherited from TimerBase
enum  Unit { SECONDS = 0 , MILLISECONDS , MICROSECONDS , NANOSECONDS }
 Unit of measure. More...
 

Detailed Description

High resolution timer.

See also
ThreadUserTimer

Definition at line 121 of file hrtimer.h.

Constructor & Destructor Documentation

◆ Timer()

Timer::Timer ( Unit  unit = TimerBase::SECONDS,
bool  stuckAtZero = false 
)
inline

Construct a Timer.

Parameters
unitthe unit of measure
stuckAtZeroflag

Definition at line 127 of file hrtimer.h.

Member Function Documentation

◆ GetCurrentTimerValue()

TimerWord Timer::GetCurrentTimerValue ( )
virtual

Retrieve the current timer value.

Returns
the current timer value

Implements TimerBase.

◆ TicksPerSecond()

TimerWord Timer::TicksPerSecond ( )
virtual

Retrieve ticks per second.

Returns
ticks per second

TicksPerSecond() is not the timer resolution. It is a conversion factor into seconds.

Implements TimerBase.


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