©2009 Microsoft Corporation. All rights reserved.
QueryPerformanceFrequency Function

The QueryPerformanceFrequency function retrieves the frequency of the high-resolution performance counter, if one exists. The frequency cannot change while the system is running.

Syntax

BOOL QueryPerformanceFrequency(      
    LARGE_INTEGER *lpFrequency );

Parameters

lpFrequency
[out] Pointer to a variable that receives the current performance-counter frequency, in counts per second. If the installed hardware does not support a high-resolution performance counter, this parameter can be zero.

Return Value

If the installed hardware supports a high-resolution performance counter, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError [ http://msdn.microsoft.com/en-us/library/ms679360(VS.85).aspx ] . For example, if the installed hardware does not support a high-resolution performance counter, the function fails.

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 [ http://msdn.microsoft.com/en-us/library/ms632592(VS.85).aspx ] , QueryPerformanceCounter [ http://msdn.microsoft.com/en-us/library/ms644904(VS.85).aspx ]
Tags: 
 
Community Content
vb.net syntax   Last Edit 11:36 AM by dmex   
<DllImport("kernel32.dll", SetLastError:=True)> _
Public Shared Function QueryPerformanceFrequency(<Out> ByRef lpFrequency As Long) As Boolean
End Function
Tags: 
C# syntax   Last Edit 11:37 AM by dmex   
[DllImport("kernel32.dll", SetLastError=true)]
public static extern bool QueryPerformanceFrequency(out long lpFrequency);
Tags: