I haven't tested this yet but it should work. The implementation is fairly simple. I don't have my laptop so I can debug the code at the present time. This basically increments the frame count everytime the game draws itself (allowing us to calculate frames per second considering the draw method is called as needed not by update). I'm over at a friend's house at the present time and was showing her how XNA Framework operates, then the idea came to me to develop a FPS Monitor. I will be developing a few other ideas I have when I get home. The current time is 19:46PM CST (Central Standard Time); My ETA is around 21:00PM.
// Implementation
// This is supposed to be your Game1.cs file.
// As I stated, I don't have my laptop so nothing is exact. But this should work 100%.
// If it doesn't then I will update it around 9pm Central Time tonight when I get home to my laptop.
FPSMonitor fps;
public override void Initialize()
{
fps = new FPSMonitor(this);
fps.Initialize();
}
public override void Update(GameTime gameTime)
{
fps.Update(gameTime);
}
public override void Draw(GameTime gameTime)
{
spriteBatch.Begin();
spriteBatch.DrawString(YourSpriteFont, "FPS: " + fps.Value.ToString(), new Vector2(5, 5), Color.White);
spriteBatch.End();
}