SGTimeStamp Class Reference

The SGTimeStamp class allows you to mark and compare time stamps with microsecond accuracy (if your system has support for this level of accuracy. More...

#include <timestamp.hxx>

List of all members.

Public Member Functions

 SGTimeStamp ()
 Default constructor.
 SGTimeStamp (const long s, const long m)
 This creates an instance of the SGTimeStamp object.
 ~SGTimeStamp ()
void stamp ()
 Update stored time to current time (seconds and microseconds).
SGTimeStampoperator= (const SGTimeStamp &t)
 Compare two time stamps for equality.
long get_seconds () const
 
Returns:
the saved seconds of this time stamp

long get_usec () const
 
Returns:
the saved microseconds of this time stamp


Friends

SGTimeStamp operator+ (const SGTimeStamp &t, const long &m)
 Increment the saved time by the specified number of microseconds.
long operator- (const SGTimeStamp &a, const SGTimeStamp &b)
 Subtract two time stamps returning the difference in microseconds.


Detailed Description

The SGTimeStamp class allows you to mark and compare time stamps with microsecond accuracy (if your system has support for this level of accuracy.

)

The SGTimeStamp is useful for tracking the elapsed time of various events in your program. You can also use it to keep constistant motion across varying frame rates.

Definition at line 54 of file timestamp.hxx.


Constructor & Destructor Documentation

SGTimeStamp::SGTimeStamp ( const long  s,
const long  m 
) [inline]

This creates an instance of the SGTimeStamp object.

When calling the constructor you may provide initial seconds an microseconds values.

Parameters:
s initial seconds value
m initial microseconds value

Definition at line 111 of file timestamp.hxx.


Friends And Related Function Documentation

SGTimeStamp operator+ ( const SGTimeStamp t,
const long &  m 
) [friend]

Increment the saved time by the specified number of microseconds.

Parameters:
t time stamp
m microseconds increment
Returns:
new time stamp

Definition at line 107 of file timestamp.cxx.

long operator- ( const SGTimeStamp a,
const SGTimeStamp b 
) [friend]

Subtract two time stamps returning the difference in microseconds.

Parameters:
a timestamp 1
b timestame 2
Returns:
difference in microseconds

Definition at line 113 of file timestamp.cxx.


The documentation for this class was generated from the following files:
Generated on Mon Dec 17 09:30:58 2007 for SimGear by  doxygen 1.5.1