GL Studio C++ Runtime API
Timer Class Reference

#include <timer.h>

Public Member Functions

 Timer (void)
 
void Reset (void)
 
virtual unsigned long ElapsedMilliseconds (void)
 
virtual unsigned long ElapsedMicroseconds (void)
 
virtual unsigned long ElapsedSeconds (void)
 
virtual double ElapsedSecondsDouble (void)
 
virtual unsigned long GetCurrentTimeInSeconds (void)
 
virtual void GetTimeOfDay (unsigned long *sec, unsigned long *usec)
 
virtual void GetTimeOfDay (INT_64 *usec)
 
virtual void WaitMilliseconds (unsigned long milli)
 
virtual void WaitMicroseconds (unsigned long micro)
 
virtual unsigned long DifferenceInMicroseconds (unsigned long sec, unsigned long usec)
 
virtual double DifferenceInSeconds (unsigned long sec, unsigned long usec)
 
virtual unsigned long DIS_Timestamp (void)
 

Detailed Description

The Timer class

Constructor & Destructor Documentation

Timer ( void  )

Timer constructor.

Member Function Documentation

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
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
virtual unsigned long DIS_Timestamp ( void  )
virtual

Create a DIS timestamp based on the current time of day

Returns
Return a DIS timestamp
virtual unsigned long ElapsedMicroseconds ( void  )
virtual

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

Returns
Return the elapsed Microseconds since the beginning of the epoch
virtual unsigned long ElapsedMilliseconds ( void  )
virtual

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

Returns
Return the elapsed milliseconds since the beginning of the epoch
virtual unsigned long ElapsedSeconds ( void  )
virtual

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

Returns
Return the number of seconds since the beginning of the epoch
virtual double ElapsedSecondsDouble ( void  )
virtual

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

Returns
The number of seconds elapsed since the beginning of the epoch
virtual unsigned long GetCurrentTimeInSeconds ( void  )
virtual

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

Returns
Return the number of seconds
virtual void GetTimeOfDay ( unsigned long *  sec,
unsigned long *  usec 
)
virtual

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 factional second in microseconds
virtual void GetTimeOfDay ( INT_64 *  usec)
virtual

Get number of microseconds elapsed since 01/01/1970

Parameters
usecReturn number of microseconds elapsed
void Reset ( void  )

Reset the timer so current time is the time base, reset "epoch time" to the current time

virtual void WaitMicroseconds ( unsigned long  micro)
virtual

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
virtual void WaitMilliseconds ( unsigned long  milli)
virtual

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: