Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is the HPET directly accessible in Windows?

I would like to use the High Performance Event Timer (HPET) for an profiling tool to take very high precision measurements, quickly. timeGetTime does not provide sufficient resolution at 1ms, and QueryPerformanceCounter is much slower per read than I'd like. I came across the HPET while researching the problem, but I can't see any samples of how to actually get at it.

So can I use it directly (assembly is fine), or do I have to rely on the multimedia/high performance timing tools already built into the Win32 API?

like image 935
Promit Avatar asked Apr 24 '09 15:04

Promit


People also ask

Is HPET on by default?

If you are using Win7 or higher, then it doesn't have it enabled by default. Enabled in BIOS doesn't mean it is being used. Win10 uses a much more efficient TSC on the CPU as default, regardless of HPET being enabled in BIOS. You'll only use HPET if a specific program was made to use it.

How do I enable HPET in Windows 10?

From the System Utilities screen, select System Configuration > BIOS/Platform Configuration (RBSU) > Advanced Options > High Precision Event Timer (HPET) ACPI Support. Select a setting. Enabled—The HPET is available to an operating system that supports it using the industry standard ACPI name space.

Is disabling HPET safe?

Disabling HPET distorts the system's understanding of time, which causes the system to miscount the frames in a second. If one second isn't one second, then FPS isn't FPS anymore. This data is invalid. Most games use a function called QueryPerformanceCounter() call it "QPC" for short.


1 Answers

I am also interested in using the HPET, but as a timer. The way I understand it, QueryPerformanceCounter and QueryPerformanceFrequency are actually accessing the counter and clock for the HPET, and this works under Windows XP (see, for example, http://www.geisswerks.com/ryan/FAQS/timing.html).

So as far as timing code, I think by using QueryPerformanceCounter you are in fact getting access to the counter that form the base of HPET, and this is all present in the chipset (rather than the processor).

like image 156
darda Avatar answered Nov 15 '22 18:11

darda