QueryPerformanceCounter

This function retrieves the current value of the high-resolution performance counter, if one exists.

  BOOL QueryPerformanceCounter (
LARGE_INTEGER *
  lpliPerformanceCount 
  );

Parameters

  • lpliPerformanceCount
    [out] Points to a variable that the function sets to the current performance-counter value. If the installed hardware does not support a high-resolution performance counter, this parameter can be set to zero.

Return Values

TRUE if the installed hardware supports a high-resolution performance counter; otherwise FALSE.

Remarks

The Platform Builder includes a default implementation of this function. In some cases, this functionality is implemented by using GetTickCount. In these cases, a call to this function returns the value represented by GetTickCount, and QueryPerformanceFrequency returns 1,000 (that is, 1,000 ticks per second).

The default implementation of this function can be replaced by defining a custom, high-resolution timer function based on the target device's CPU. The custom high-resolution timer functions must be implemented in the OAL code and then be exposed to the kernel.

To expose high-resolution timer functions to the kernel, the kernel provides the global variable function pointer pQueryPerformanceCounter. This global variable should be initialized such that it points to the equivalent private function (for example, OEMQueryPerformanceCounter). This private function should be initialized in the OEMInit function. Once pQueryPerformanceCounter is initialized, it points to the OAL implementation to retrieve the high-resolution timers.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 2.10 and later Mkfuncs.h    

See Also

GetTickCount, PerfCountSinceTick, pQueryPerformanceCounter, QueryPerformanceFrequency