Export (0) Print
Expand All
Expand Minimize

KeQueryPerformanceCounter routine

The KeQueryPerformanceCounter routine retrieves the current value and frequency of the performance counter.

Use KeQueryPerformanceCounter to acquire high resolution (<1us) time stamps for time interval measurements.

Syntax


LARGE_INTEGER KeQueryPerformanceCounter(
  _Out_opt_  PLARGE_INTEGER PerformanceFrequency
);

Parameters

PerformanceFrequency [out, optional]

A pointer to a variable to which KeQueryPerformanceCounter writes the performance counter frequency, in ticks per second. This parameter is optional and can be NULL if the caller does not need the counter frequency value.

Return value

KeQueryPerformanceCounter returns the performance counter value in units of ticks.

Remarks

KeQueryPerformanceCounter returns a 64-bit integer that represents the current value of a high-resolution monotonically nondecreasing counter.

To obtain the frequency of the performance counter, specify a non-NULL pointer value for the PerformanceFrequency parameter. The frequency of the performance counter is fixed at system boot and is consistent across all processors. Therefore, a driver can cache the frequency of the performance counter during initialization.

For more info about this function and its usage, see Acquiring high-resolution time stamps.

Requirements

Version

Available starting with Windows 2000.

Header

Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h)

Library

Hal.lib

IRQL

Any level

See also

KeQueryInterruptTime
KeQuerySystemTime
KeQueryTickCount
KeQueryTimeIncrement
QueryPerformanceCounter
QueryPerformanceFrequency

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft