Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
Gray::cTimePerf Class Reference

#include <cTimeSys.h>

Public Member Functions

 cTimePerf (TIMEPERF_t nTime=0) noexcept
 
 cTimePerf (int nTime) noexcept
 
 cTimePerf (bool bTrue) noexcept
 
bool isTimeValid () const noexcept
 
void InitTimeNow () noexcept
 
TIMEPERF_t get_Perf () const noexcept
 
TIMEPERF_t GetAgeDiff (cTimePerf tStop) const noexcept
 
TIMEPERF_t get_AgePerf () const noexcept
 
double get_Seconds () const noexcept
 
double get_AgeSeconds () const noexcept
 
double get_Days () const noexcept
 

Static Public Member Functions

static bool __stdcall InitFreq () noexcept
 
static double __stdcall ToSeconds (TIMEPERF_t t) noexcept
 
static double __stdcall ToDays (TIMEPERF_t t) noexcept
 

Public Attributes

TIMEPERF_t m_nTime
 Arbitrary start time in k_nFreq units. 64 byte unsigned type. More...
 

Static Public Attributes

static const TIMEPERF_t sm_nFreq = cTimeSpec::k_FREQ
 nanosecond accurate. for linux using cTimeSpec More...
 

Detailed Description

Very high rate timer. 64 bit. like the X86 'rdtsc' instruction. TIMEPERF_t = The system very high precision performance timer. Maybe nSec ?

Constructor & Destructor Documentation

◆ cTimePerf() [1/3]

Gray::cTimePerf::cTimePerf ( TIMEPERF_t  nTime = 0)
inlinenoexcept

default = init to 0.

◆ cTimePerf() [2/3]

Gray::cTimePerf::cTimePerf ( int  nTime)
inlinenoexcept

default = init to 0. Allow constants to not have a convert.

◆ cTimePerf() [3/3]

Gray::cTimePerf::cTimePerf ( bool  bTrue)
inlinenoexcept

Member Function Documentation

◆ get_AgePerf()

TIMEPERF_t Gray::cTimePerf::get_AgePerf ( ) const
inlinenoexcept

how long ago was this ?

◆ get_AgeSeconds()

double Gray::cTimePerf::get_AgeSeconds ( ) const
inlinenoexcept

how long ago was this ? TIMESECF_t

◆ get_Days()

double Gray::cTimePerf::get_Days ( ) const
inlinenoexcept

Convert cTimePerf to double days (from arbitrary start time).

Returns
time in days since some unknown/arbitrary starting point

◆ get_Perf()

TIMEPERF_t Gray::cTimePerf::get_Perf ( ) const
inlinenoexcept

Get the time stamp.

◆ get_Seconds()

double Gray::cTimePerf::get_Seconds ( ) const
inlinenoexcept

convert arbitrary start time to seconds (type = double) TIMESECF_t

◆ GetAgeDiff()

TIMEPERF_t Gray::cTimePerf::GetAgeDiff ( cTimePerf  tStop) const
inlinenoexcept

how long ago was this ?

◆ InitFreq()

bool GRAYCALL Gray::cTimePerf::InitFreq ( )
staticnoexcept

need to call this once in _WIN32 to capture the k_nFreq

◆ InitTimeNow()

void Gray::cTimePerf::InitTimeNow ( )
noexcept

QueryPerformanceCounter() is better than 'rdtsc' for multi core. available >= Windows 2000

◆ isTimeValid()

bool Gray::cTimePerf::isTimeValid ( ) const
inlinenoexcept

◆ ToDays()

double GRAYCALL Gray::cTimePerf::ToDays ( TIMEPERF_t  t)
staticnoexcept

Convert cTimePerf to double days (from arbitrary start time).

Returns
time in days since some unknown/arbitrary starting point

◆ ToSeconds()

static double __stdcall Gray::cTimePerf::ToSeconds ( TIMEPERF_t  t)
inlinestaticnoexcept

Member Data Documentation

◆ m_nTime

TIMEPERF_t Gray::cTimePerf::m_nTime

Arbitrary start time in k_nFreq units. 64 byte unsigned type.

◆ sm_nFreq

const TIMEPERF_t Gray::cTimePerf::sm_nFreq = cTimeSpec::k_FREQ
static

nanosecond accurate. for linux using cTimeSpec


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