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. 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

Tags :


Community Content

dmex
vb.net syntax
<DllImport("kernel32.dll", SetLastError:=True)> _
Public Shared Function QueryPerformanceFrequency(<Out> ByRef lpFrequency As Long) As Boolean
End Function
Tags :

dmex
C# syntax
[DllImport("kernel32.dll", SetLastError=true)]
public static extern bool QueryPerformanceFrequency(out long lpFrequency);
Tags :

Page view tracker