Click here to Skip to main content
15,867,594 members
Articles / Desktop Programming / XAML

Enabling Frame Rate Counters for XAML Applications in Windows 8

Rate me:
Please Sign up or sign in to vote.
4.83/5 (7 votes)
23 Sep 2011CPOL1 min read 29.6K   11   5
A look at how to enable Frame Rate Counter for XAML Applications in Windows 8

No demo project included.

Introduction

One of the things that we all look at before we ship software is the performance of our apps. Last November, I posted a quick and easy way to do it in Silverlight. Today, I am going to walk you through doing it in Windows 8 for your Metro XAML applications.

After the Build event was over, I was interested in learning how to do this for my Windows 8 Metro Apps. I started watching videos from the Build RSS Feed and noticed this one from Tim Heuer that did just that.

Let’s Get Started

Click/Touch the “Developer Command Prompt” to begin.

Image 1

That will open a Developer Command Prompt. At the command prompt, simply type in “regedit” without quotes as shown below.

Image 2

Add the Registry Key

Now, depending on the version of Windows 8 you have installed, navigate and add the following key.

32-bit version of Windows 8

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Xaml]

"EnableFrameRateCounter"=dword :00000001

64-bit

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Xaml]

"EnableFrameRateCounter"=dword :00000001

In my case, I was using Windows 8 64-bit. I had to create a new key called XAML and added a DWORD (32-bit) named EnableFrameRateCounter with a value of 1.

Image 3

Image 4

Let’s Test It

All you have to do now is to run any XAML / C# Metro Application.

Image 5

Ok, so what do these numbers mean? Again, thanks to Tim Heuer for the nice slide.

Image 6

You will notice that any application built using XAML / C# will display this framerate counter. Even the ones that ship with Windows 8. (For example: The Memories application)

Image 7

What about HTML / JS Apps?

It will not work with HTML / JS Metro Applications as I tried it. I think that is why the registry key starts with “XAML”. =)

Image 8

Image 9

Thanks for reading!

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Telerik
United States United States
Michael Crump is a Silverlight MVP and MCPD that has been involved with computers in one way or another for as long as he can remember, but started professionally in 2002. After spending years working as a systems administrator/tech support analyst, Michael branched out and started developing internal utilities that automated repetitive tasks and freed up full-time employees. From there, he was offered a job working at McKesson corporation and has been working with some form of .NET and VB/C# since 2003.

He has worked at Fortune 500 companies where he gained experience in embedded systems design and software development to systems administration and database programming, and everything in between.

His primary focus right now is developing healthcare software solutions using Microsoft .NET technologies. He prefers building infrastructure components, reusable shared libraries and helping companies define, develop and automate process standards and guidelines.

You can read his blog at: MichaelCrump.net or follow him on Twitter at @mbcrump.

Comments and Discussions

 
QuestionNo longer necessary Pin
Morten on GIS20-Mar-12 21:52
Morten on GIS20-Mar-12 21:52 
With consumer preview, now all you have to do is add the following to App.Xaml.cs's OnLaunched method:

Application.Current.DebugSettings.EnableFrameRateCounter = true;
GeneralMy vote of 5 Pin
GPUToaster™26-Sep-11 1:29
GPUToaster™26-Sep-11 1:29 
QuestionMy vote of 5 Pin
Shahriar Iqbal Chowdhury/Galib24-Sep-11 6:48
professionalShahriar Iqbal Chowdhury/Galib24-Sep-11 6:48 
GeneralMy vote of 5 Pin
Kunal Chowdhury «IN»24-Sep-11 4:07
professionalKunal Chowdhury «IN»24-Sep-11 4:07 
GeneralMy vote of 5 Pin
Burak Ozdiken24-Sep-11 2:53
Burak Ozdiken24-Sep-11 2:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.