TickCounter.cpp 578 B

1234567891011121314151617181920212223
  1. // Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
  2. // SPDX-FileCopyrightText: 2021 Jorrit Rouwe
  3. // SPDX-License-Identifier: MIT
  4. #include <Jolt/Jolt.h>
  5. #include <Jolt/Core/TickCounter.h>
  6. #include <Jolt/Core/IncludeWindows.h>
  7. JPH_NAMESPACE_BEGIN
  8. #if defined(JPH_PLATFORM_WINDOWS_UWP) || (defined(JPH_PLATFORM_WINDOWS) && defined(JPH_CPU_ARM))
  9. uint64 GetProcessorTickCount()
  10. {
  11. LARGE_INTEGER count;
  12. QueryPerformanceCounter(&count);
  13. return uint64(count.QuadPart);
  14. }
  15. #endif // JPH_PLATFORM_WINDOWS_UWP || (JPH_PLATFORM_WINDOWS && JPH_CPU_ARM)
  16. JPH_NAMESPACE_END