GL Studio C++ Runtime API
Timer Class Reference

The Timer class. More...

#include <timer.h>

Public Member Functions

void Reset ()
 Reset the timer so current time is the time base, reset "epoch time" to the current time.
 
virtual unsigned long ElapsedMilliseconds ()
 
virtual unsigned long ElapsedMicroseconds ()
 
virtual unsigned long ElapsedSeconds ()
 
virtual double ElapsedSecondsDouble ()
 
virtual unsigned long DifferenceInMicroseconds (unsigned long sec, unsigned long usec)
 
virtual double DifferenceInSeconds (unsigned long sec, unsigned long usec)
 

Static Public Member Functions

static unsigned long GetCurrentTimeInSeconds ()
 
static void GetTimeOfDay (unsigned long *sec, unsigned long *usec)
 
static void GetTimeOfDay (INT_64 *usec)
 
static void WaitMilliseconds (unsigned long milli)
 
static void WaitMicroseconds (unsigned long micro)
 
static unsigned long DIS_Timestamp ()
 

Detailed Description

The Timer class.

Member Function Documentation

◆ DifferenceInMicroseconds()

virtual unsigned long DifferenceInMicroseconds ( unsigned long  sec,
unsigned long  usec 
)
virtual

Get the difference between a time value and when the "epoch time" began.

Parameters
secTime in seconds to compare to "epoch time".
usecTime in microseconds to compare to "epoch time".
Returns
Return the difference between the time parameters, and the "epoch time", in Microseconds.

◆ DifferenceInSeconds()

virtual double DifferenceInSeconds ( unsigned long  sec,
unsigned long  usec 
)
virtual

Get the difference between a time value and when the "epoch time" began.

Parameters
secTime in seconds to compare to "epoch time"
usecTime in microseconds to compare to "epoch time"
Returns
Return the difference between the time parameters, and the "epoch time", in Seconds

◆ DIS_Timestamp()

static unsigned long DIS_Timestamp ( )
static

Create a DIS timestamp based on the current time of day.

Returns
Return a DIS timestamp

◆ ElapsedMicroseconds()

virtual unsigned long ElapsedMicroseconds ( )
virtual

Get the number of microseconds elapsed since the "epoch time" began.

Returns
The elapsed Microseconds since the beginning of the epoch.

◆ ElapsedMilliseconds()

virtual unsigned long ElapsedMilliseconds ( )
virtual

Get the number of milliseconds elapsed since the "epoch time" began.

Returns
The elapsed milliseconds since the beginning of the epoch.

◆ ElapsedSeconds()

virtual unsigned long ElapsedSeconds ( )
virtual

Get the number of seconds elapsed since the "epoch time" began.

Returns
The number of seconds since the beginning of the epoch.

◆ ElapsedSecondsDouble()

virtual double ElapsedSecondsDouble ( )
virtual

Get the number of seconds elapsed since the "epoch time" began.

Returns
The number of seconds elapsed since the beginning of the epoch.

◆ GetCurrentTimeInSeconds()

static unsigned long GetCurrentTimeInSeconds ( )
static

Get the number of seconds elapsed since 01/01/1970, "wall clock".

Returns
Return the number of seconds.

◆ GetTimeOfDay() [1/2]

static void GetTimeOfDay ( INT_64 usec)
static

Get number of microseconds elapsed since 01/01/1970.

Parameters
usecReturn number of microseconds elapsed.

◆ GetTimeOfDay() [2/2]

static void GetTimeOfDay ( unsigned long *  sec,
unsigned long *  usec 
)
static

Get the number of seconds elapsed since 01/01/1970, and the number of microseconds elapsed in the current second.

Parameters
secReturn the number of seconds elapsed since 01/01/1970
usecReturn the fractional second in microseconds

◆ WaitMicroseconds()

static void WaitMicroseconds ( unsigned long  micro)
static

Cause the process (or thread) to sleep for the specified number of microseconds. Clock time continues, this pauses the thread, not the clock.

Parameters
microHow long to sleep im micoseconds.

◆ WaitMilliseconds()

static void WaitMilliseconds ( unsigned long  milli)
static

Cause the process (or thread) to sleep for the specified number of milliseconds. Clock time continues, this pauses the thread, not the clock.

Parameters
milliHow long to sleep in milliseconds.

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