次の方法で共有


QueryPerformanceFrequency

This function retrieves the frequency, in counts per second, of the high-resolution performance counter.

  BOOL QueryPerformanceFrequency (
LARGE_INTEGER *
  lpliFrequency 
  );

Parameters

  • lpliFrequency
    [out] Points to a variable that the function sets to the current frequency of the performance counter; the frequency is given in counts per second. 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, the QueryPerformanceCounter functionality is implemented by using GetTickCount. In these cases, a call to this function returns 1,000 (1,000 ticks per second).

The default implementation of QueryPerformanceFrequency 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 do this, the kernel exposes the global variable pQueryPerformanceFrequency.

Initialize pQueryPerformanceFrequency to point to the equivalent private function (for example, OEMQueryPerformanceFrequency). This should be initialized in OEMInit. Once pQueryPerformanceFrequency 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

pQueryPerformanceFrequency, QueryPerformanceCounter