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

#include <cTimeSys.h>

Public Member Functions

 cTimeSys () noexcept
 
 cTimeSys (const cTimeSys &t) noexcept
 
 cTimeSys (TIMESYS_t t) noexcept
 
bool isTimeValid () const noexcept
 
TIMESYS_t get_TimeSys () const noexcept
 
void InitTime (TIMESYS_t t=k_CLEAR) noexcept
 
void InitTimeNow () noexcept
 
void InitTimeNowPlusSys (TIMESYSD_t iOffset) noexcept
 
void InitTimeNowPlusSec (float fOffsetSec) noexcept
 
bool isTimeFuture () const noexcept
 
TIMESYSD_t get_TimeTilSys () const noexcept
 
TIMESYSD_t get_AgeSys () const noexcept
 
TIMESECF_t get_TimeTilSecF () const noexcept
 
TIMESECF_t get_AgeSecF () const noexcept
 
TIMESECD_t get_AgeSec () const noexcept
 

Static Public Member Functions

static TIMESYS_t GetTimeNow () noexcept
 
static unsigned long __stdcall WaitSpin (TIMESYSD_t t)
 

Static Public Attributes

static const TIMESYS_t k_CLEAR = 0
 
static const TIMESYS_t k_FREQ = 1000
 milliSec per Sec More...
 
static const TIMESYS_t k_INF = UINT_MAX
 INFINITE in _WIN32. MAILSLOT_WAIT_FOREVER. More...
 
static const TIMESYSD_t k_DMAX = INT_MAX
 Max diff in time. More...
 

Friends

class cTimeSysTests
 

Detailed Description

Time in milliseconds from arbitrary/unknown start time. Unsigned 32 bits will roll every 49.7 days. _WIN32 = start time = when system was last rebooted.

Constructor & Destructor Documentation

◆ cTimeSys() [1/3]

Gray::cTimeSys::cTimeSys ( )
inlinenoexcept

◆ cTimeSys() [2/3]

Gray::cTimeSys::cTimeSys ( const cTimeSys t)
inlinenoexcept

◆ cTimeSys() [3/3]

Gray::cTimeSys::cTimeSys ( TIMESYS_t  t)
inlinenoexcept

Member Function Documentation

◆ get_AgeSec()

TIMESECD_t Gray::cTimeSys::get_AgeSec ( ) const
inlinenoexcept

How old is this? (in seconds) current time - this time.

◆ get_AgeSecF()

TIMESECF_t Gray::cTimeSys::get_AgeSecF ( ) const
inlinenoexcept

in float seconds.

◆ get_AgeSys()

TIMESYSD_t Gray::cTimeSys::get_AgeSys ( ) const
inlinenoexcept

How long ago was this ? (was TIMESYS_GetAge(x))

Returns
signed TIMESYS_t (mSec) <0 = t is in the future. >0 = t is in the past.

◆ get_TimeSys()

TIMESYS_t Gray::cTimeSys::get_TimeSys ( ) const
inlinenoexcept

◆ get_TimeTilSecF()

TIMESECF_t Gray::cTimeSys::get_TimeTilSecF ( ) const
inlinenoexcept

in float seconds.

◆ get_TimeTilSys()

TIMESYSD_t Gray::cTimeSys::get_TimeTilSys ( ) const
inlinenoexcept

How long until this time (msec)

Returns
>0 = m_TimeSys is in the future.

◆ GetTimeNow()

static TIMESYS_t Gray::cTimeSys::GetTimeNow ( )
inlinestaticnoexcept
Note
ASSUME this is FAST ! _WIN32 is limited to the resolution of the system timer, which is typically in the range of 10 milliseconds to 16 milliseconds.

◆ InitTime()

void Gray::cTimeSys::InitTime ( TIMESYS_t  t = k_CLEAR)
inlinenoexcept

◆ InitTimeNow()

void Gray::cTimeSys::InitTimeNow ( )
inlinenoexcept

◆ InitTimeNowPlusSec()

void Gray::cTimeSys::InitTimeNowPlusSec ( float  fOffsetSec)
inlinenoexcept

◆ InitTimeNowPlusSys()

void Gray::cTimeSys::InitTimeNowPlusSys ( TIMESYSD_t  iOffset)
inlinenoexcept

◆ isTimeFuture()

bool Gray::cTimeSys::isTimeFuture ( ) const
inlinenoexcept

◆ isTimeValid()

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

◆ WaitSpin()

unsigned long GRAYCALL Gray::cTimeSys::WaitSpin ( TIMESYSD_t  t)
static

Wait a certain amount of time. Spin instead of sleeping. Do NOT yield time to other threads. (NOT Sleep)

Friends And Related Function Documentation

◆ cTimeSysTests

friend class cTimeSysTests
friend

Member Data Documentation

◆ k_CLEAR

const TIMESYS_t Gray::cTimeSys::k_CLEAR = 0
static

◆ k_DMAX

const TIMESYSD_t Gray::cTimeSys::k_DMAX = INT_MAX
static

Max diff in time.

◆ k_FREQ

const TIMESYS_t Gray::cTimeSys::k_FREQ = 1000
static

milliSec per Sec

◆ k_INF

const TIMESYS_t Gray::cTimeSys::k_INF = UINT_MAX
static

INFINITE in _WIN32. MAILSLOT_WAIT_FOREVER.


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