OpenHardwareMonitor.TryGetAverage<T> Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Tries to calculate the average of a set of sensors.
C#
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
- T
Type of value to query (i.e. Load, Power)
- hardware
- OpenHardwareMonitor.Hardware
The hardware type (i.e. CPU)
- average
- T
Gets the returned quantity
True if at least one matching quantity was found
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)
Toode | Versioonid |
---|---|
.NET IoT Libraries | 1.1.0, 1.2.0, 1.3.0, 1.4.0, 1.5.0, 2.0.0, 2.1.0, 2.2.0 |