MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/FleX / GetSeconds

Function GetSeconds

core/platform.cpp:48–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46#include <mmsystem.h>
47
48double GetSeconds()
49{
50 static LARGE_INTEGER lastTime;
51 static LARGE_INTEGER freq;
52 static bool first = true;
53
54 if (first)
55 {
56 QueryPerformanceCounter(&lastTime);
57 QueryPerformanceFrequency(&freq);
58
59 first = false;
60 }
61
62 static double time = 0.0;
63
64 LARGE_INTEGER t;
65 QueryPerformanceCounter(&t);
66
67 __int64 delta = t.QuadPart-lastTime.QuadPart;
68 double deltaSeconds = double(delta) / double(freq.QuadPart);
69
70 time += deltaSeconds;
71
72 lastTime = t;
73
74 return time;
75
76}
77
78void Sleep(double seconds)
79{

Callers 6

ImportMeshFromBinFunction · 0.85
CreateSDFFunction · 0.85
UpdateFrameFunction · 0.85
CreateSoftBodyMethod · 0.85
CreatePlasticBodyMethod · 0.85
CreateRigidBodyMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected