Free Electron
Public Member Functions | Static Public Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
fe::SystemTicker Class Reference

High precision timer. More...

#include <SystemTicker.h>

Public Member Functions

 SystemTicker (const char *name)
 
 SystemTicker (const char *group, const char *name)
 
unsigned long timeMS (void)
 Returns a time in milliseconds from an arbitrary fixed reference point. More...
 
void log (const char *fmt,...)
 
void log (void)
 

Static Public Member Functions

static void FE_CDECL calibrate (void)
 Perform a self-contained recalibration. More...
 
static unsigned long ticksPerMS (void)
 Returns the approximate number of processor clock ticks that occur every millisecond. More...
 
static unsigned long tickDifference (unsigned long start, unsigned long finish)
 Return the reltive tick change between two absolute tick values. More...
 
static float microsecondsPerTick ()
 Returns the fractional number of microseonds for each processor clock tick. More...
 

Static Private Member Functions

static void staticInit (void)
 

Private Attributes

unsigned long m_lastincl
 
unsigned long m_lastexcl
 
String m_name
 
String m_group
 
unsigned long m_lasttick
 
struct timeval m_timer
 

Static Private Attributes

static unsigned long ms_ticksPerMS = 1
 
static float ms_usPerTick = 1
 

Detailed Description

High precision timer.

Member Function Documentation

◆ calibrate()

static void FE_CDECL fe::SystemTicker::calibrate ( void  )
inlinestatic

Perform a self-contained recalibration.

Must be performed at least once before TicksPerMS can be considered useful.

◆ microsecondsPerTick()

static float fe::SystemTicker::microsecondsPerTick ( )
inlinestatic

Returns the fractional number of microseonds for each processor clock tick.

Referenced by fe::systemMicroseconds().

◆ tickDifference()

static unsigned long fe::SystemTicker::tickDifference ( unsigned long  start,
unsigned long  finish 
)
inlinestatic

Return the reltive tick change between two absolute tick values.

Rollover is corrected.

◆ ticksPerMS()

static unsigned long fe::SystemTicker::ticksPerMS ( void  )
inlinestatic

Returns the approximate number of processor clock ticks that occur every millisecond.

◆ timeMS()

unsigned long fe::SystemTicker::timeMS ( void  )

Returns a time in milliseconds from an arbitrary fixed reference point.

This number can loop.


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