MSDN Home >  MSDN Library >  User Interface Design and Development >  Windows User Interface >  Windowing >  Timers > 

QueryPerformanceCounter Function


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 machine, 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

HeaderDeclared in Winbase.h, include Windows.h
Import libraryKernel32.lib
Minimum operating systems Included in Windows 95, Windows NT 3.1

See Also

Timers Overview, QueryPerformanceFrequency
  Contact Us   |   E-Mail this Page   |   MSDN Flash Newsletter
  © 2002 Microsoft Corporation. All rights reserved.     Terms of Use    Privacy Statement     Accessibility