Edit

Share via


OpenHardwareMonitor.TryGetAverage<T> Method

Definition

Tries to calculate the average of a set of sensors.

public bool TryGetAverage<T> (Iot.Device.HardwareMonitor.OpenHardwareMonitor.Hardware hardware, out T? average) where T : UnitsNet.IQuantity;
member this.TryGetAverage : Iot.Device.HardwareMonitor.OpenHardwareMonitor.Hardware * 'T -> bool (requires 'T :> UnitsNet.IQuantity)
Public Function TryGetAverage(Of T As IQuantity) (hardware As OpenHardwareMonitor.Hardware, ByRef average As T) As Boolean

Type Parameters

T

Type of value to query (i.e. Load, Power)

Parameters

hardware
OpenHardwareMonitor.Hardware

The hardware type (i.e. CPU)

average
T

Gets the returned quantity

Returns

True if at least one matching quantity was found

Exceptions

There were multiple sensors found, but they return different units (i.e. CPU temperature is reported as Celsius for some cores and Fahrenheit for others)

Applies to