ForegroundEnergyDiagnostics Class
Definition
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.
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 ref class ForegroundEnergyDiagnostics abstract sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class ForegroundEnergyDiagnostics final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Deprecated("Foreground Energy Diagnostics has been deprecated. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 393216, "Windows.Foundation.UniversalApiContract")]
class ForegroundEnergyDiagnostics final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public static class ForegroundEnergyDiagnostics
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Deprecated("Foreground Energy Diagnostics has been deprecated. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 393216, "Windows.Foundation.UniversalApiContract")]
public static class ForegroundEnergyDiagnostics
Public Class ForegroundEnergyDiagnostics
- Inheritance
- Attributes
Windows requirements
Device family |
Windows 10 (introduced in 10.0.10240.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced in v1.0)
|
Remarks
Important
These APIs consume significant CPU resources. We recommend using these APIs only for debugging purposes.
Properties
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() |
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() |
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. |