Home / Forums / High-Precision Timers in Windows: QueryPerformanceCounter vs GetSystemTimePreciseAsFileTime

UnreliableCode Community

Developer Research, Reverse Engineering & Coding Community

Tutorial

High-Precision Timers in Windows: QueryPerformanceCounter vs GetSystemTimePreciseAsFileTime

ByteSurgeon
Cheat Engine Specialist
MEMBER
Rep: 140
Join Date: Mar 2025
Posts: 19
Thanks: 30
2y ago · Jul 4, 2024 7:51 PM
#1
QueryPerformanceCounter (QPC) reads the hardware TSC (Time Stamp Counter) via ACPI/HPET with sub-microsecond precision.
ByteSurgeon | Cheat Engine & Lua Automation
The following users thanked ByteSurgeon for this post:
KronoDev
C++ / Game Modder
MEMBER
Rep: 195
Join Date: Jan 2023
Posts: 32
Thanks: 48
2y ago · Jul 4, 2024 11:07 PM
#2
GetSystemTimePreciseAsFileTime provides high-precision synchronized UTC clock time for network timestamping.
KronoDev - Keep coding, keep learning
NullPtr_
Assembly & Engine Research
MEMBER
Rep: 260
Join Date: May 2023
Posts: 27
Thanks: 62
2y ago · Jul 5, 2024 5:07 AM
#3
QPC is monotonic and immune to NTP system clock adjustments, making it the only choice for game loop delta time.
NullPtr_ · 0xDEADBEEF was here