Kernel32QueryIdleProcessorCycleTime Method

Retrieves the cycle time for the idle thread of each processor in the system.

On a system with more than 64 processors, this function retrieves the cycle time for the idle thread of each processor in the processor group to which the calling thread is assigned.

Use the QueryIdleProcessorCycleTimeEx(UInt16, UInt32, IntPtr) function to retrieve the cycle time for the idle thread on each logical processor for a specific processor group.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Kernel32.dll", ExactSpelling = true, SetLastError = true)]
public static bool QueryIdleProcessorCycleTime(
	ref uint refBufferLength,
	IntPtr processorIdleCycleTime
)

Parameters

refBufferLength  UInt32
On input, specifies the size of the processorIdleCycleTime buffer, in bytes. This buffer is expected to be 8 times the number of processors in the group.

On output, specifies the number of elements written to the buffer. If the buffer size is not sufficient, the function fails and this parameter receives the required length of the buffer.

processorIdleCycleTime  IntPtr
The number of CPU clock cycles used by each idle thread. This buffer must be 8 times the number of processors in the system in size.

Return Value

Boolean
If the function succeeds, the return value is .

If the function fails, the return value is .

To get extended error information, call GetLastWin32Error.

Remarks

See Also