TimeStep is a higher-level utility for keeping track of time the duration of game timesteps. More...
#include <sifteo/time.h>
Public Member Functions | |
SystemTime | begin () const |
Retrieve the SystemTime at the beginning of the interval described by delta(). More... | |
TimeDelta | delta () const |
Retrieve the duration of the last time interval. More... | |
SystemTime | end () const |
Retrieve the SystemTime at the end of the interval described by delta(). More... | |
void | next () |
Advance to the next time interval. More... | |
TimeStep is a higher-level utility for keeping track of time the duration of game timesteps.
At any time, delta() can be used to retrieve the duration of the last timestep, as a TimeDelta object. The next() call ends the current timestep and begins the next one simultaneously, without losing any time in-between.
TimeStep is guaranteed not to inclur cumulative rounding errors due to loss of precision when converting SystemTime into TimeDelta.
|
inline |
Retrieve the SystemTime at the beginning of the interval described by delta().
This is the time at the second to last call to next(), which must have been called at least twice.
|
inline |
Retrieve the duration of the last time interval.
If less than two calls to next() have elapsed, this returns a zero-length interval.
|
inline |
Retrieve the SystemTime at the end of the interval described by delta().
This is the time at the last call to next(), which must have been called at least once.
|
inline |
Advance to the next time interval.
This samples the system clock, as the end of the previous interval and the beginning of the next.
Sifteo SDK v1.1.0 (see all versions)
Last updated Tue Dec 23 2014, by Doxygen