The QueryPerformanceCounter function retrieves the current value of the high-resolution performance counter.
Syntax
|
BOOL QueryPerformanceCounter( LARGE_INTEGER *lpPerformanceCount
); |
Parameters
- lpPerformanceCount
-
[out] 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.
Remarks
On a multiprocessor computer, it should not matter which processor is called. However, you can get different results on different processors due to bugs in the basic input/output system (BIOS) or the hardware abstraction layer (HAL). To specify processor affinity for a thread, use the SetThreadAffinityMask function.
Function Information
| Minimum DLL Version | kernel32.dll |
|---|
| Header | Declared in Winbase.h, include Windows.h |
|---|
| Import library | Kernel32.lib |
|---|
| Minimum operating systems |
Windows 95, Windows NT 3.1 |
|---|
| Unicode | Implemented as
Unicode version. |
|---|
See Also
Timers Overview, QueryPerformanceFrequency