ForegroundEnergyDiagnostics ForegroundEnergyDiagnostics ForegroundEnergyDiagnostics ForegroundEnergyDiagnostics Class

Definition

Provides debugging APIs for calculating your app's foreground energy usage in real time. We recommend using these APIs only for debugging.

Important

These APIs consume significant CPU resources. We recommend using these APIs only for debugging purposes.

public : static class ForegroundEnergyDiagnosticspublic static class ForegroundEnergyDiagnosticsPublic Static Class ForegroundEnergyDiagnostics// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Important

These APIs consume significant CPU resources. We recommend using these APIs only for debugging purposes.

Properties

DeviceSpecificConversionFactor DeviceSpecificConversionFactor DeviceSpecificConversionFactor DeviceSpecificConversionFactor

Gets the device-specific conversion factor used to convert energy usage (mW) to a normalized percentage.

Important

These APIs consume significant CPU resources. We recommend using these APIs only for debugging purposes.

public : static double DeviceSpecificConversionFactor { get; }public static double DeviceSpecificConversionFactor { get; }Public Static ReadOnly Property DeviceSpecificConversionFactor As double// You can use this property in JavaScript.
Value
double double double double

The device-specific conversion factor used to convert energy usage (mW) to a normalized percentage

Remarks

To determine the estimated energy usage for the device in units of milliwatts (mW), divide the computed total energy usage by the DeviceSpecificConversionFactor.

Methods

ComputeTotalEnergyUsage() ComputeTotalEnergyUsage() ComputeTotalEnergyUsage() ComputeTotalEnergyUsage()

Computes the total cumulative energy usage of the foreground app since the last reset, expressed as a percentage of normal.

Important

This method consumes significant CPU resources. We recommend using this method only for debugging purposes.

public : static ulong ComputeTotalEnergyUsage()public static ulong ComputeTotalEnergyUsage()Public Static Function ComputeTotalEnergyUsage() As ulong// You can use this method in JavaScript.
Returns
ulong ulong ulong ulong

The total cumulative energy usage of the foreground app since the last reset, expressed as a percentage of normal.

Remarks

Important

This method consumes significant CPU resources. We recommend using this method only for debugging purposes.

Reset the energy usage total by calling ResetTotalEnergyUsage.

The energy usage of a foreground app is classified into one these predefined levels, from lowest to highest energy consumption: LowUsageLevel, NearMaxAcceptableUsageLevel, MaxAcceptableUsageLevel, or ExcessiveUsageLevel.

ResetTotalEnergyUsage() ResetTotalEnergyUsage() ResetTotalEnergyUsage() ResetTotalEnergyUsage()

Clears the value that represents the total cumulative energy usage of the foreground app since the last reset.

Important

These APIs consume significant CPU resources. We recommend using these APIs only for debugging purposes.

public : static void ResetTotalEnergyUsage()public static void ResetTotalEnergyUsage()Public Static Function ResetTotalEnergyUsage() As void// You can use this method in JavaScript.

Remarks

This method doesn't reduce energy consumption, it simply resets the counter used to track total energy usage.