Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 782431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:23:08+00:00 2026-05-14T20:23:08+00:00

How does XNA maintain a consistent and precise 60 FPS frame rate? Additionally, how

  • 0

How does XNA maintain a consistent and precise 60 FPS frame rate? Additionally, how does it maintain such precise timing without pegging the CPU at 100%?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T20:23:09+00:00Added an answer on May 14, 2026 at 8:23 pm

    I don’t know specifically how XNA does it but when playing around with OpenGL a few years ago I accomplished the same thing using some very simple code.

    at the core of it i assume XNA has some sort of rendering loop, it may or may not be integrated with a standard even processing loop but for the sake of example lets assume it isn’t. in this case you could write it some thing like this.

    TimeSpan FrameInterval =  TimeSpan.FromMillis(1000.0/60.0);
    DateTime PrevFrameTime = DateTime.MinValue;
    while(true)
    {
        DateTime CurrentFrameTime = DateTime.Now;
        TimeSpan diff = DateTime.Now - PrevFrameTime;
        if(diff < FrameInterval)
        {
            DrawScene();
            PrevFrameTime = CurrentFrameTime;
        }
        else
        {
            Thread.Sleep(FrameInterval - diff);
        }
    }
    

    In reality you would probably use something like Environment.Ticks instead of DateTimes (it would be more accurate), but i think that this illustrates the point. This should only call drawScene about 60 times a second, and the rest of the time the thread will be sleeping so it will not incur any CPU time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Comparison between XNA and DirectX (C#) The subject speaks for itself. Does
How does the font size work in sprite fonts in C# XNA? For example
One interfaces with XNA through C#, but does anyone know what language the library
How often does XNA on WP7 read touches state? Can I make XNA do
Does anybody know how to access the Xbox Live Avatar from within an XNA
What are the differences between using VertexPositionNormalTexture and VertexPositionTexture in XNA? Does the GPU
Does anybody know if its possible to use Microsoft.Xna.Framework.Media.MediaLibrary for design time data? I'm
Does anyone have an example of implementing Orbital Mechanics (preferably in XNA)? The code
I think opengl can automatically generate mipmap texture, does XNA support this?
Does anybody know some XNA 4.0 papers. I'm interested in e-books and other documents/papers.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.