I'm experimenting with replacing RtlQueryPerformanceCounter
in Windows to use the RDTSC
instruction for performance timing. I also patched RtlQueryPerformanceFrequency
to use a calculated frequency that matches the RDTSC
output. its works amazing
The issue I'm facing is that the system time accelerates extremely fast—e.g., it jumps from 11/25/2024 to 03/05/2025 in just a few seconds. I’m considering using KeUpdateSystemTime to manually adjust and synchronize the system time with the correct real-time values. is there a better way to synchronize the system time to not go fast when using rdtsc ?