PdhGetCounterTimeBase function

Returns the time base of the specified counter.

Syntax

PDH_FUNCTION PdhGetCounterTimeBase(
  PDH_HCOUNTER hCounter,
  LONGLONG     *pTimeBase
);

Parameters

hCounter

Handle to the counter. The PdhAddCounter function returns this handle.

pTimeBase

Time base that specifies the number of performance values a counter samples per second.

Return value

If the function succeeds, it returns ERROR_SUCCESS.

If the function fails, the return value is a system error code or a PDH error code. The following are possible values.

Return code Description
PDH_INVALID_ARGUMENT
The specified counter does not use a time base.
PDH_INVALID_HANDLE
The counter handle is not valid.

Remarks

If you use the PdhFormatFromRawValue function to calculate a displayable value instead of calling the PdhCalculateCounterFromRawValue function, you must call the PdhGetCounterTimeBase function to retrieve the time base.

Each counter that returns time-based performance data has a time base defined for it. The time base of a counter is the number of times a counter samples data per second.

Requirements

   
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header pdh.h
Library Pdh.lib
DLL Pdh.dll

See also

PdhFormatFromRawValue