What is Frame Rate Counters?

When you run an app in Windows Phone Emulator, you can use the frame rate counters to monitor the performance of your app. The following illustration shows the frame rate counters.

You can enable or disable the display of the frame rate counters in your code. When you create a Windows Phone app project in Visual Studio, the following code to enable the frame rate counters is added by default in the file App.xaml.cs.

// Show graphics profiling information while debugging.
if (System.Diagnostics.Debugger.IsAttached)
{
// Display the current frame rate counters.
Application.Current.Host.Settings.EnableFrameRateCounter = true;

// other code…
}

To disable the frame rate counters

• Comment out the line of code that enables the frame rate counters as shown in the following code.





// Display the current frame rate counters.
//Application.Current.Host.Settings.EnableFrameRateCounter = true;

or

• Set EnableFrameRateCounter to false as shown in the following code.

// Do not display the current frame rate counters.
Application.Current.Host.Settings.EnableFrameRateCounter = false;

To enable the frame rate counters

• Set EnableFrameRateCounter to true as shown in the following code.

// Display the current frame rate counters.
Application.Current.Host.Settings.EnableFrameRateCounter = true;

Leave a Reply