UtilProcessGetProcessCpuPercentUsageAsync(Process) Method

Asynchronously gets the CPU percentage usage for the specified Process.

Definition

Namespace: DevCase.Core.Diagnostics.Processes
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static Task<float> GetProcessCpuPercentUsageAsync(
	Process pr
)

Parameters

pr  Process
The Process.

Return Value

TaskSingle
The resulting CPU percentage usage for the specified Process.

Remarks

Before calling this method, performance counters must be enabled in the 'app.config' file. See the next example: <configuration> ... <system.net> <settings> <performanceCounters enabled="true"/> </settings> </system.net> ... </configuration>

Example

This is a code example.
C#
No code example is currently available or this language may not be supported.

See Also