Simple real time clock based on Ogre::Timer.
More...
#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/util/Clock.h>
Simple real time clock based on Ogre::Timer.
The class can be used to both capture the current real time or to incrementally capture the time and then distribute that time information via Clock& references (for instance for the game tick).
Precision:
- Precision
- The maximum precision is given by the Ogre::Timer and that is somewhere in the microsecond range for both Windows and UNIX.
- Remarks for Usage on Windows
- For proper functionality this class MUST be used in the same thread!
Furthermore it might be possible that the Ogre::Timer has a performance caveat because it will only capture the time on the same CPU core. Confining the main thread to one process could speed up the game.
orxonox::Clock::Clock |
( |
| ) |
|
orxonox::Clock::~Clock |
( |
| ) |
|
orxonox::Clock::Clock |
( |
const Clock & |
| ) |
|
|
privatedelete |
void orxonox::Clock::capture |
( |
| ) |
|
Internally captures the time and stays at that particular time.
float orxonox::Clock::getDeltaTime |
( |
| ) |
const |
|
inline |
Returns the timespan in seconds between the last two calls to capture()
long orxonox::Clock::getDeltaTimeMicroseconds |
( |
| ) |
const |
|
inline |
Returns the timespan in microseconds between the last two calls to capture()
unsigned long long orxonox::Clock::getMicroseconds |
( |
| ) |
const |
|
inline |
Returns the last captured absolute time in microseconds.
unsigned long long orxonox::Clock::getMilliseconds |
( |
| ) |
const |
|
inline |
Returns the last captured absolute time in milliseconds.
unsigned long long orxonox::Clock::getRealMicroseconds |
( |
| ) |
const |
Returns the current real time in microseconds.
- Note
- This is especially useful to measure execution times because of the high precision.
unsigned long orxonox::Clock::getSeconds |
( |
| ) |
const |
|
inline |
Returns the last captured absolute time in seconds.
float orxonox::Clock::getSecondsPrecise |
( |
| ) |
const |
|
inline |
Returns the last captured absolute time in seconds as float.
Clock& orxonox::Clock::operator= |
( |
const Clock & |
| ) |
|
|
privatedelete |
long orxonox::Clock::tickDt_ |
|
private |
Delta time in microseconds (cache value)
float orxonox::Clock::tickDtFloat_ |
|
private |
Delta time in seconds (cache value)
unsigned long long orxonox::Clock::tickTime_ |
|
private |
Ogre::Timer* orxonox::Clock::timer_ |
|
private |
The documentation for this class was generated from the following files: