MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / _updateTime

Method _updateTime

Engine/source/platform/platformTimer.cpp:27–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25#include "console/engineAPI.h"
26
27void TimeManager::_updateTime()
28{
29 // Calculate & filter time delta since last event.
30
31 // How long since last update?
32 S32 delta = mTimer->getElapsedMs();
33
34 // Now - we want to try to sleep until the time threshold will hit.
35 S32 msTillThresh = (mBackground ? mBackgroundThreshold : mForegroundThreshold) - delta;
36
37 if(msTillThresh > 0)
38 {
39 // There's some time to go, so let's sleep.
40 Platform::sleep( msTillThresh );
41 }
42
43 // Ok - let's grab the new elapsed and send that out.
44 S32 finalDelta = mTimer->getElapsedMs();
45 mTimer->reset();
46
47 timeEvent.trigger(finalDelta);
48}
49
50TimeManager::TimeManager()
51{

Callers

nothing calls this directly

Calls 3

getElapsedMsMethod · 0.45
resetMethod · 0.45
triggerMethod · 0.45

Tested by

no test coverage detected