timing.h File Reference

High-resolution, low-cost timing routines. More...

+ Include dependency graph for timing.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ArchIntervalTimer
 A simple timer class for measuring an interval of time using the ArchTickTimer facilities. More...
 

Functions

uint64_t ArchGetTickTime ()
 Return the current time in system-dependent units. More...
 
uint64_t ArchGetStartTickTime ()
 Get a "start" tick time for measuring an interval of time, followed by a later call to ArchGetStopTickTime(). More...
 
uint64_t ArchGetStopTickTime ()
 Get a "stop" tick time for measuring an interval of time. More...
 
ARCH_API uint64_t ArchGetTickQuantum ()
 Return the tick time resolution. More...
 
ARCH_API uint64_t ArchGetIntervalTimerTickOverhead ()
 Return the ticks taken to record an interval of time with ArchIntervalTimer, as measured at startup time. More...
 
ARCH_API int64_t ArchTicksToNanoseconds (uint64_t nTicks)
 Convert a duration measured in "ticks", as returned by ArchGetTickTime(), to nanoseconds. More...
 
ARCH_API double ArchTicksToSeconds (uint64_t nTicks)
 Convert a duration measured in "ticks", as returned by ArchGetTickTime(), to seconds. More...
 
ARCH_API uint64_t ArchSecondsToTicks (double seconds)
 Convert a duration in seconds to "ticks", as returned by ArchGetTickTime(). More...
 
ARCH_API double ArchGetNanosecondsPerTick ()
 Get nanoseconds per tick. More...
 
template<class Fn >
uint64_t ArchMeasureExecutionTime (Fn const &fn, uint64_t maxMicroSeconds=10000, bool *reachedConsensus=nullptr)
 Run fn repeatedly attempting to determine a consensus fastest execution time with low noise, for up to maxMicroseconds, then return the consensus fastest execution time. More...
 

Detailed Description

High-resolution, low-cost timing routines.

Definition in file timing.h.