Supporting High-Resolution Timers (Windows CE 5.0)

Send Feedback

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

Completing an OAL

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.