MCPcopy Create free account
hub / github.com/crownengine/crown / getHPCounter

Function getHPCounter

3rdparty/bx/src/timer.cpp:25–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23namespace bx
24{
25 int64_t getHPCounter()
26 {
27#if BX_CRT_NONE
28 int64_t i64 = crt0::getHPCounter();
29#elif BX_PLATFORM_WINDOWS \
30 || BX_PLATFORM_XBOXONE \
31 || BX_PLATFORM_WINRT
32 LARGE_INTEGER li;
33 QueryPerformanceCounter(&li);
34 int64_t i64 = li.QuadPart;
35#elif BX_PLATFORM_ANDROID
36 struct timespec now;
37 clock_gettime(CLOCK_MONOTONIC, &now);
38 int64_t i64 = now.tv_sec*INT64_C(1000000000) + now.tv_nsec;
39#elif BX_PLATFORM_EMSCRIPTEN
40 int64_t i64 = int64_t(1000.0f * emscripten_get_now() );
41#elif !BX_PLATFORM_NONE
42 struct timeval now;
43 gettimeofday(&now, NULL);
44 int64_t i64 = now.tv_sec*INT64_C(1000000) + now.tv_usec;
45#else
46 BX_ASSERT(false, "Not implemented!");
47 int64_t i64 = UINT64_MAX;
48#endif // BX_PLATFORM_
49 return i64;
50 }
51
52 int64_t getHPFrequency()
53 {

Callers 15

submitMethod · 0.85
initMethod · 0.85
swapMethod · 0.85
flipMethod · 0.85
setFrameBufferMethod · 0.85
submitMethod · 0.85
beginMethod · 0.85
endMethod · 0.85
beginFunction · 0.85
endFunction · 0.85
apiSemWaitMethod · 0.85
renderSemWaitMethod · 0.85

Calls 2

clock_gettimeFunction · 0.85
gettimeofdayFunction · 0.85

Tested by

no test coverage detected