|
|
The TimeKeeper class tracks the passing of time and allows to stop it, restart it, and adjust its speed (only used by ArmarXTimeServer). More...
#include <ArmarXCore/core/time/TimeKeeper.h>
Public Member Functions | |
| float | getSpeed () |
| IceUtil::Time | getTime () const |
| get the current time of this clock More... | |
| void | reset () |
| resets the clock More... | |
| void | setSpeed (float newSpeed) |
| sets the speed factor of the clock More... | |
| void | start () |
| starts the clock More... | |
| void | step (IceUtil::Time stepSize) |
| adds a timedelta to the current time More... | |
| void | stop () |
| stops the clock. More... | |
| TimeKeeper () | |
The TimeKeeper class tracks the passing of time and allows to stop it, restart it, and adjust its speed (only used by ArmarXTimeServer).
Internally the current time is represented as a combination of start time, speed and an offset. The current time (i.e. the output of getTime()) is always (IceUtil::Time::now() - startTime) * speed + offset. When the timer is paused and unpaused or the speed changes, offset gets increased by (IceUtil::Time::now() - starttime) * speed and starttime gets reset to the current time.
Definition at line 41 of file TimeKeeper.h.
| TimeKeeper | ( | ) |
| float getSpeed | ( | ) |
| IceUtil::Time getTime | ( | ) | const |
get the current time of this clock
Definition at line 36 of file TimeKeeper.cpp.
Here is the caller graph for this function:| void reset | ( | ) |
resets the clock
Definition at line 50 of file TimeKeeper.cpp.
Here is the caller graph for this function:| void setSpeed | ( | float | newSpeed | ) |
sets the speed factor of the clock
| newSpeed | new speed factor |
Sets how fast the clock is running. e.g. a value of 0.5 means that the clock only ticks with half the speed of the system clock.
Definition at line 58 of file TimeKeeper.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void start | ( | ) |
starts the clock
Definition at line 72 of file TimeKeeper.cpp.
Here is the caller graph for this function:| void step | ( | IceUtil::Time | stepSize | ) |
adds a timedelta to the current time
| stepSize | how much to add |
Definition at line 92 of file TimeKeeper.cpp.
Here is the caller graph for this function:| void stop | ( | ) |
stops the clock.
This does not reset the clock.
Definition at line 82 of file TimeKeeper.cpp.
Here is the call graph for this function:
Here is the caller graph for this function: