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.
void stamp ()
 Update stored time to current time (seconds and microseconds).
long get_seconds () const
long get_usec () const

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 107 of file timestamp.hxx.


Member Function Documentation

long SGTimeStamp::get_seconds (  )  const [inline]

Returns:
the saved seconds of this time stamp

Definition at line 95 of file timestamp.hxx.

long SGTimeStamp::get_usec (  )  const [inline]

Returns:
the saved microseconds of this time stamp

Definition at line 98 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 86 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 92 of file timestamp.cxx.


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

Generated on Thu Dec 18 15:17:28 2008 for SimGear by  doxygen 1.5.6