Debian Codegraph @

thirdparty/jolt_physics/Jolt/Core/TickCounter.cpp

raw
1 // Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
2 // SPDX-FileCopyrightText: 2021 Jorrit Rouwe
3 // SPDX-License-Identifier: MIT
4
5 #include <Jolt/Jolt.h>
6
7 #include <Jolt/Core/TickCounter.h>
8
9 #if defined(JPH_PLATFORM_WINDOWS)
10 JPH_SUPPRESS_WARNING_PUSH
11 JPH_MSVC_SUPPRESS_WARNING(5039) // winbase.h(13179): warning C5039: 'TpSetCallbackCleanupGroup': pointer or reference to potentially throwing function passed to 'extern "C"' function under -EHc. Undefined behavior may occur if this function throws an exception.
12 #ifndef WIN32_LEAN_AND_MEAN
13 #define WIN32_LEAN_AND_MEAN
14 #endif
15 #ifndef JPH_COMPILER_MINGW
16 #include <Windows.h>
17 #else
18 #include <windows.h>
19 #endif
20 JPH_SUPPRESS_WARNING_POP
21 #endif
22
23 JPH_NAMESPACE_BEGIN
24
25 #if defined(JPH_PLATFORM_WINDOWS_UWP) || (defined(JPH_PLATFORM_WINDOWS) && defined(JPH_CPU_ARM))
26
27 uint64 GetProcessorTickCount()
28 {
29 LARGE_INTEGER count;
30 QueryPerformanceCounter(&count);
31 return uint64(count.QuadPart);
32 }
33
34 #endif // JPH_PLATFORM_WINDOWS_UWP || (JPH_PLATFORM_WINDOWS && JPH_CPU_ARM)
35
36 JPH_NAMESPACE_END