Supporting High-Resolution Timers (Windows CE 5.0)
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
- Provide your own implementations of the OEMQueryPerformanceCounter and OEMQueryPerformanceFrequency functions.
- Add code to OEMInit to set the variables pQueryPerformanceCounter and pQueryPerformanceFrequency to point to your implementations of the OEMQueryPerformanceCounter and OEMQueryPerformanceFrequency functions.
- Make any further calls to the QueryPerformance functions through their respective pointers.
See Also
Send Feedback on this topic to the authors