Click to Rate and Give Feedback
MSDN
MSDN Library
User Interface
Windowing
Timers
Timer Reference
Functions
 QueryPerformanceCounter Function
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 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 Versionkernel32.dll
HeaderDeclared in Winbase.h, include Windows.h
Import libraryKernel32.lib
Minimum operating systems Windows 95, Windows NT 3.1
UnicodeImplemented as Unicode version.

See Also

Timers Overview, QueryPerformanceFrequency
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content      
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker