Dela via


DebugSettings.EnableFrameRateCounter Property

Definition

Gets or sets a value that indicates whether to display frame-rate and per-frame CPU usage info. These display as an overlay of counters in the window chrome while the app runs.

public:
 property bool EnableFrameRateCounter { bool get(); void set(bool value); };
bool EnableFrameRateCounter();

void EnableFrameRateCounter(bool value);
public bool EnableFrameRateCounter { get; set; }
var boolean = debugSettings.enableFrameRateCounter;
debugSettings.enableFrameRateCounter = boolean;
Public Property EnableFrameRateCounter As Boolean

Property Value

Boolean

bool

true to display the overlay debug counters; otherwise, false.

Remarks

The overlay debug counters have two sets of numbers. The set that appears on the upper left of the screen applies to just your app. The set that appears on the upper right applies to the system overall, and is also accounting for other apps that are drawing to the composited desktop. The right-side counter comes from the Microsoft DirectComposition components that are handling compositing for Microsoft Windows in general. Basically, if you set EnableFrameRateCounter to true, this also calls IDCompositionDeviceDebug.EnableDebugCounters in the underlying components. The result is that both the counters specific to apps using XAML and the Microsoft DirectComposition counters for all apps appear when you debug your UWP app.

The format for the frame-rate counter displayed in the window chrome is:

App fps App CPU Sys fps Sys CPU
000 000 000 000
The app's UI thread frame rate, in frames per second. The CPU usage of the app's UI thread per frame, in milliseconds. The system-wide composition engine frame rate, in frames per second. This is typically pegged to 60. The system-wide overall CPU usage of the composition thread per frame, in milliseconds.

The App fps value is specifically reporting on the UI thread. There could be a much higher apparent refresh rate happening in your app that's related to the composition thread, but not to the UI thread. For more info on what each thread is responsible for, see Performance best practices for .

OnLaunched is a good place to change DebugSettings values. Another possibility is the App() constructor.

Notes for previous versions

Windows 8 In Windows 8, the counters used a different format and didn't incorporate the Microsoft DirectComposition counters. That format was:

000000000000000000000
*Comp fps**UI fps**Memory**Batch**Comp ms**UI ms*
  • Comp fps: the frame rate for the composition thread
  • UI fps: the frame rate for the UI thread
  • Memory: memory utilization for textures
  • Batch: the count of surfaces that are sent to the graphics processing unit (GPU)
  • Comp ms: time in milliseconds per frame spent on the composition thread
  • UI ms: time in milliseconds per frame spent on the UI thread

Applies to

See also