QueryPerformanceCounter function

Retrieves the current value of the performance counter, which is a high resolution (<1us) time stamp that can be used for time-interval measurements.

Syntax


BOOL WINAPI QueryPerformanceCounter(
  _Out_  LARGE_INTEGER *lpPerformanceCount
);

Parameters

lpPerformanceCount [out]

A pointer to a variable that receives the current performance-counter value, in counts.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError. On systems that run Windows XP or later, the function will always succeed and will thus never return zero.

Remarks

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

Windows Phone 8: This API is supported.

Windows Phone 8.1: This API is supported.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps | Windows Store apps]

Minimum supported server

Windows 2000 Server [desktop apps | Windows Store apps]

Header

Winbase.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

See also

Reference
GetSystemTimePreciseAsFileTime
KeQueryPerformanceCounter
QueryPerformanceFrequency
Conceptual
Acquiring high-resolution time stamps
Time
Timers

 

 

Community Additions

ADD
Show:
© 2014 Microsoft