Platform SDK: Performance Monitoring

PdhGetCounterTimeBase

The PdhGetCounterTimeBase function returns the time base of the specified counter.

PDH_STATUS PdhGetCounterTimeBase(
  HCOUNTER hCounter,        
  LONGLONG *pTimeBase       
);

Parameters

hCounter
[in] A handle to the counter.
pTimeBase
[out] A pointer to a variable that receives the time base. The time base is the number of performance values a counter samples per second.

Return Values

If the function succeeds, it returns ERROR_SUCCESS.

If the function fails, the return value is a PDH error status defined in PDHMsg.h. The following are possible error values.

Error value Description
PDH_INVALID_ARGUMENT An argument is not correct or is incorrectly formatted.
PDH_INVALID_HANDLE The counter handle is not valid.

Remarks

This function can be used to get the time base for a subsequent call to the PdhFormatFromRawValue function.

If a non-time-based counter is specified, PDH_INVALID_ARGUMENT will be returned.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Header: Declared in Pdh.h.
  Library: Use Pdh.lib.

See Also

PdhFormatFromRawValue