MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / getElapsedMs

Method getElapsedMs

Engine/source/platformWin32/winTimer.cpp:59–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57 }
58
59 const S32 getElapsedMs()
60 {
61 if(mUsingPerfCounter)
62 {
63 // Use QPC, update remainders so we don't leak time, and return the elapsed time.
64 QueryPerformanceCounter( (LARGE_INTEGER *) &mPerfCountNext);
65 F64 elapsedF64 = (1000.0 * F64(mPerfCountNext - mPerfCountCurrent) / F64(mFrequency));
66 elapsedF64 += mPerfCountRemainderCurrent;
67 U32 elapsed = (U32)mFloor(elapsedF64);
68 mPerfCountRemainderNext = elapsedF64 - F64(elapsed);
69
70 return elapsed;
71 }
72 else
73 {
74 // Do something naive with GTC.
75 mTickCountNext = GetTickCount();
76 return mTickCountNext - mTickCountCurrent;
77 }
78 }
79
80 void reset()
81 {

Callers 14

updateMethod · 0.45
GFXD3D9OcclusionQueryMethod · 0.45
endMethod · 0.45
getStatusMethod · 0.45
endMethod · 0.45
_updateMethod · 0.45
renderMethod · 0.45
renderMethod · 0.45
_onPreRenderMethod · 0.45
_updateTimeMethod · 0.45
stopTimerMethod · 0.45

Calls 2

mFloorFunction · 0.85
GetTickCountFunction · 0.85

Tested by

no test coverage detected