ForegroundEnergyDiagnostics 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 ForegroundEnergyDiagnostics
static struct winrt::Windows::System::Power::Diagnostics::ForegroundEnergyDiagnostics
public static class ForegroundEnergyDiagnostics
Public Shared Class ForegroundEnergyDiagnostics
// This class does not provide a public constructor.
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 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.

Methods

ComputeTotalEnergyUsage() 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.

ResetTotalEnergyUsage() 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.