How do I get microsecond resolution timestamps on Windows?
I am loking for something better than QueryPerformanceCounter and QueryPerformanceFrequ
I discovered difficulties using PerformanceCounter together with PerformanceCounterFrequency, because the given PerformanceCounterFrequency deviates from the actual frequency.
It deviates by an offset, and it also shows thermal drift. Newer hardware seems to have less drift, but the drift and the offset are quite considerable. A drift of a few ppm will already damage the microsecond accuracy to a large extend since 1 ppm is 1 µs/s! Therefore a careful hardware-specific calibration is strongly recommended when using PerformanceCounter with PerformanceCounterFrequency. This may also be the reason why "crazy results" are observed when not calling certain functions frequently.
I did some more detailed investigations on this matter. A description can be found in Microsecond Resolution Time Services for Windows.