BackgroundEnergyDiagnostics
BackgroundEnergyDiagnostics
BackgroundEnergyDiagnostics
BackgroundEnergyDiagnostics
Class
Definition
Provides debugging APIs for calculating your app's background 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 BackgroundEnergyDiagnosticspublic static class BackgroundEnergyDiagnosticsPublic Static Class BackgroundEnergyDiagnostics// You can use this class in JavaScript.
- Attributes
| 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 background task 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.
The total cumulative energy usage of the background task since the last reset, expressed as a percentage of normal.
Remarks
Reset the energy usage total by calling ResetTotalEnergyUsage.
The energy usage of a background task is classified into one of these predefined levels, from lowest to highest energy consumption: LowUsageLevel, NearMaxAcceptableUsageLevel, MaxAcceptableUsageLevel, ExcessiveUsageLevel, NearTerminationUsageLevel, or TerminationUsageLevel.
ResetTotalEnergyUsage() ResetTotalEnergyUsage() ResetTotalEnergyUsage() ResetTotalEnergyUsage()
Clears the value that represents the total cumulative energy usage of the background task 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.