Is QueryPerformanceFrequency accurate when using HPET?

I play with QueryPerformanceFrequency. He used to return 3.6 Mhz, but that was not enough for what I was trying to do.

I turned HPETon using this command bcdedit /set useplatformclock true. Now it returns 14.3 Mhz. It's great, more precisely ... excluded. I quickly realized that I did not get the grit that I expected.

If I try to interrogate QueryPerformanceCounteruntil it starts ticking, the smallest value I can get is 11what it means 1.27Mhz. If I try to count the number of different values, I can get from QueryPerformanceCounterin one second, I get 1.26Mhz.

So, I was wondering if there is a way to really make full use of 14.3 Mhzit?

I am using Windows 7, 64 bit system, visual studio 2008.

+4
source share
1 answer

Using HPET hardware as a source for QueryPerformanceCounter (QPC) is known to be very expensive.

QPC is an expensive setup call with HPET.

It provides 14.3 MHz, which implies high accuracy, but, as you have discovered, it cannot be called fast enough to actually allow this frequency.

Microsoft CPU (TSC) QPC , . TSC . , QPC, , 1024; .

QPC TSC , ( 20-30 15-20 /). , . 0,3 us ( CPU 3,4 ).

HPET 3,6 . , , ACPI PM (3579545 ) , QPC TSC, HPET.

, , HPET ACPI PM . , (PCF), QPC . QPC TSC QPC.

Microsoft :

. (MSDN 2014).

. A QPC.

... 14,3 ?

, .

Coreinfo.exe Windows Sysinternals. Sysinternals Microsoft. : Sysinternals System Information Utilities. : , TSC?

: // QPC TSC.

BTW: QPC GetSystemTimePreciseAsFileTime ( Windows 8 ), QPC.

+6

Source: https://habr.com/ru/post/1535589/


All Articles