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

  • Home
  • SEARCH
  • 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 4101358
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:41:12+00:00 2026-05-20T20:41:12+00:00

I want to time fps count, and set it’s limit to 60 and however

  • 0

I want to time fps count, and set it’s limit to 60 and however i’ve been looking throught some code via google, I completly don’t get it.

  • 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-20T20:41:13+00:00Added an answer on May 20, 2026 at 8:41 pm

    You shouldn’t try to limit the fps. The only reason to do so is if you are not using delta time and you expect each frame to be the same length. Even the simplest game cannot guarantee that.

    You can however take your delta time and slice it into fixed sizes and then hold onto the remainder.

    Here’s some code I wrote recently. It’s not thoroughly tested.

    void GameLoop::Run()
    {
        m_Timer.Reset();
    
        while(!m_Finished())
        {
            Time delta = m_Timer.GetDelta();
            Time frameTime(0);
            unsigned int loopCount = 0;
    
            while (delta > m_TickTime && loopCount < m_MaxLoops)
            {
                m_SingTick();
                delta -= m_TickTime;
                frameTime += m_TickTime;
                ++loopCount;
            }
            m_Independent(frameTime);
    
            // add an exception flag later.
            // This is if the game hangs
            if(loopCount >= m_MaxLoops)
            {
                delta %= m_TickTime;
            }
    
            m_Render(delta);
            m_Timer.Unused(delta);
        }
    }
    

    The member objects are Boost slots so different code can register with different timing methods. The Independent slot is for things like key mapping or changing music Things that don’t need to be so precise. SingTick is good for physics where it is easier if you know every tick will be the same but you don’t want to run through a wall. Render takes the delta so animations run smooth, but must remember to account for it on the next SingTick.

    Hope that helps.

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

Sidebar

Related Questions

I want to measure time memory allocation using this code: long AForMemory = DateTime.Now.Ticks;
I'm looking to get some additional performance (FPS) increases on my iPhone App. I'm
I'm working on some real-time image processing projects in C# and I want to
We want to time how long certain actions run for in an ASP.NET MVC
e.g. I want the time difference between asia/kolkata time and asia/dubai .
In my activity there is a toggle button. I want every time you change
I want get the time used for a case so I can create an
I want to display time on my page in real tics format like running
It seems that every time I want to perform a db query, I have
I have a time interval that spans years and I want all the time

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.