|
TrueReality
v0.1.1912
|
Timer class is used for measuring elapsed time or time between two points. More...
#include <Timer.h>
Public Member Functions | |
| Timer () | |
| Default constructor. More... | |
| ~Timer () | |
| Destructor. More... | |
| TimeTicks | Tick () |
| Get the timers tick value. More... | |
| void | SetStartTick () |
| Set the start tick. More... | |
| void | SetStartTick (TimeTicks t) |
| Set the start tick to a custom value. More... | |
| TimeTicks | GetStartTick () const |
| Get the value of the start tick. More... | |
| double | DeltaSec (TimeTicks t1, TimeTicks t2) const |
| Get the time in seconds between timer ticks t1 and t2. More... | |
| double | DeltaMil (TimeTicks t1, TimeTicks t2) const |
| Get the time in milliseconds between timer ticks t1 and t2. More... | |
| double | DeltaMicro (TimeTicks t1, TimeTicks t2) const |
| Get the time in microseconds between timer ticks t1 and t2. More... | |
| double | DeltaNano (TimeTicks t1, TimeTicks t2) const |
| Get the time in nanoseconds between timer ticks t1 and t2. More... | |
| double | ElapsedSeconds () const |
| Get elapsed time in seconds. More... | |
| double | ElapsedMilliseconds () const |
| Get elapsed time in milliseconds. More... | |
| double | ElapsedMicroseconds () const |
| Get elapsed time in microseconds. More... | |
| double | ElapsedNanoseconds () const |
| Get elapsed time in nanoseconds. More... | |
| double | GetSecondsPerCPUTick () const |
| Get the number of seconds per CPU tick. More... | |
| double | GetSecondsPerTick () const |
| Get the number of seconds per tick. More... | |
Static Public Member Functions | |
| static const Timer * | Instance () |
| Creates and returns a global timer. More... | |
Private Attributes | |
| osg::Timer | mTimer |
| TimeTicks | mOldTicks = 0 |
| TimeTicks | mNewTicks = 0 |
| TimeTicks | mCustomTicks = 0 |
Timer class is used for measuring elapsed time or time between two points.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Get the number of seconds per tick.
Definition at line 232 of file Timer.h.
Referenced by trCore::SceneObjects::RingArrayCallback::operator()(), trCore::SystemDirector::Run(), and trCore::SystemDirector::RunOnce().

|
inline |
|
static |
Creates and returns a global timer.
This allows the user to use the timer class as a singleton. It can still be declared locally though, without the use of Instance()
|
inline |
Set the start tick.
Definition at line 112 of file Timer.h.
Referenced by trCore::SceneObjects::RingArrayCallback::operator()(), trCore::SystemDirector::Run(), and trCore::SystemDirector::RunOnce().

| void trUtil::Timer::SetStartTick | ( | TimeTicks | t | ) |
|
inline |
Get the timers tick value.
Definition at line 100 of file Timer.h.
Referenced by trCore::SceneObjects::RingArrayCallback::operator()(), trCore::SystemDirector::Run(), and trCore::SystemDirector::RunOnce().

|
private |
Definition at line 238 of file Timer.h.
Referenced by SetStartTick().
|
private |
Definition at line 237 of file Timer.h.
Referenced by SetStartTick().
|
private |
Definition at line 236 of file Timer.h.
Referenced by SetStartTick().
|
private |
Definition at line 235 of file Timer.h.
Referenced by SetStartTick().