Share via


ForegroundEnergyDiagnostics.ComputeTotalEnergyUsage Method

Definition

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 unsigned long long ComputeTotalEnergyUsage();
 static uint64_t ComputeTotalEnergyUsage();
/// [Windows.Foundation.Metadata.Deprecated("Background Energy Diagnostics has been deprecated. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 393216, "Windows.Foundation.UniversalApiContract")]
 static uint64_t ComputeTotalEnergyUsage();
public static ulong ComputeTotalEnergyUsage();
[Windows.Foundation.Metadata.Deprecated("Background Energy Diagnostics has been deprecated. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 393216, "Windows.Foundation.UniversalApiContract")]
public static ulong ComputeTotalEnergyUsage();
function computeTotalEnergyUsage()
Public Shared Function ComputeTotalEnergyUsage () As ULong

Returns

UInt64

unsigned long long

uint64_t

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

Attributes

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.

Applies to