nomlib
Loading...
Searching...
No Matches
nom::HighResolutionTimer Class Reference

High-granularity time keeper. More...

#include <HighResolutionTimer.hpp>

Public Member Functions

 HighResolutionTimer ()
 Default constructor.
 ~HighResolutionTimer ()
 Destructor.
bool started () const
bool paused () const
uint64 ticks () const
std::string ticks_str () const
void start ()
void stop ()
void restart ()
 Alias for start.
void pause ()
void unpause ()
real64 to_seconds () const
 Convert a high resolution timing value to seconds.

Static Public Member Functions

static real64 elapsed_ticks (uint64 start_hires_ticks, uint64 end_hires_ticks)
 Get the elapsed frequency count per second of the high resolution counter.
static real64 to_milliseconds (uint64 hires_ticks)
 Convert a high resolution timing value to milliseconds.
static real64 to_seconds (uint64 hires_ticks)
 Convert a high resolution timing value to seconds.

Private Attributes

bool paused_
 Activity status of the timer.
bool started_
 Running status of the timer.
uint64 elapsed_ticks_
 The recorded timestamp at the time of starting the timer.
uint64 paused_ticks_
 The recorded timestamp at the time of pausing the timer.

Detailed Description

High-granularity time keeper.

Definition at line 37 of file HighResolutionTimer.hpp.

Member Function Documentation

◆ to_milliseconds()

real64 nom::HighResolutionTimer::to_milliseconds ( uint64 hires_ticks)
static

Convert a high resolution timing value to milliseconds.

Parameters
hires_ticksA high resolution timing value to convert.
See also
::ticks, nom::hires_ticks

◆ to_seconds() [1/2]

real64 nom::HighResolutionTimer::to_seconds ( ) const

Convert a high resolution timing value to seconds.

Parameters
hires_ticksA high resolution timing value to convert.
See also
::ticks, nom::hires_ticks

◆ to_seconds() [2/2]

real64 nom::HighResolutionTimer::to_seconds ( uint64 hires_ticks)
static

Convert a high resolution timing value to seconds.

Parameters
hires_ticksA high resolution timing value to convert.
See also
::ticks, nom::hires_ticks

Member Data Documentation

◆ elapsed_ticks_

uint64 nom::HighResolutionTimer::elapsed_ticks_
private

The recorded timestamp at the time of starting the timer.

Definition at line 96 of file HighResolutionTimer.hpp.

◆ paused_

bool nom::HighResolutionTimer::paused_
private

Activity status of the timer.

Definition at line 90 of file HighResolutionTimer.hpp.

◆ paused_ticks_

uint64 nom::HighResolutionTimer::paused_ticks_
private

The recorded timestamp at the time of pausing the timer.

Definition at line 99 of file HighResolutionTimer.hpp.

◆ started_

bool nom::HighResolutionTimer::started_
private

Running status of the timer.

Definition at line 93 of file HighResolutionTimer.hpp.


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