QueryAuxiliaryCounterFrequency function

Queries the auxiliary counter frequency.


HRESULT QueryAuxiliaryCounterFrequency(
  PULONGLONG lpAuxiliaryCounterFrequency



Long pointer to an output buffer that contains the specified auxiliary counter frequency. If the auxiliary counter is not supported, the value in the output buffer will be undefined.

Return Value

Returns S_OK if the auxiliary counter is supported and E_NOTIMPL if the auxiliary counter is not supported.


You can determine the availability of the auxiliary counter by comparing the returned value against E_NOTIMPL.


The following sample describes how to call QueryAuxiliaryCounterFrequency to retrieve the counter frequency.

#include <stdio.h> 
#include <windows.h> 
wmain (int argc, wchar_t* argv[]) 

   ULONGLONG AuxiliaryCounterFrequency;
   HRESULT Result;

   Result = QueryAuxiliaryCounterFrequency(&AuxiliaryCounterFrequency); 
   if (SUCCEEDED(Result)) {
      wprintf(L"Auxiliary counter frequency is: %llu.\n", AuxiliaryCounterFrequency);
   else if (Result == E_NOTIMPL) {
      wprintf(L"Auxiliary counter is not supported.\n"); 
	  else {
    wprintf(L"Error code: 0x%x.\n", Result);

   return 0; 


Minimum supported client Windows 10, version 1703 [desktop apps | UWP apps]
Minimum supported server Windows Server 2016 [desktop apps | UWP apps]
Target Platform Windows
Header realtimeapiset.h
Library Mincore.lib
DLL Kernel32.dll