Share via


Supporting High-Resolution Timers (Windows Embedded CE 6.0)

1/5/2010

The high-resolution timer functions QueryPerformanceCounter and QueryPerformanceFrequency allow independent software vendors (ISVs) to use the high-resolution timers available on your target device.

These high-resolution timers enable more accurate timings than the one-millisecond granularity available through the GetTickCount function. For more information, see High-Performance Counter Support.

The OAL sample code provides default implementations of the performance querying functions.

If you do not provide high-resolution timers on your hardware platform, the default capabilities of the performance querying functions are implemented using GetTickCount.

In the default code, a call to QueryPerformanceCounter returns the value represented by GetTickCount, while QueryPerformanceFrequency returns 1000.

To support high-resolution timers

  1. Provide your own implementations of the OEMQueryPerformanceCounter and OEMQueryPerformanceFrequency functions.

  2. Add code to OEMInit to set the variables pQueryPerformanceCounter and pQueryPerformanceFrequency to point to your implementations of the OEMQueryPerformanceCounter and OEMQueryPerformanceFrequency functions.

  3. Make any further calls to the QueryPerformance functions through their respective pointers.

See Also

Tasks

Completing an OAL