Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


syncing a program with the system clock

This topic is 5397 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Guest Anonymous Poster
Check out the articles here:


They provide a decent framework for setting up a timing loop in accordance with system time and running your game at a suitable rate.

Share this post

Link to post
Share on other sites
Btw, on Windows with QueryPerformance, is there a way to avoid the timing to "block" during a very short period (this often happens when the system swaps during maybe 1/10 of sec). I sometimes have jerky motion and I wanted to know if you have the same problems. I update the timer once at the beginning of the main loop and stores the result in float format. Then I use the delta_time between two frames to update the velocity, position,...

[edited by - bucheron on October 12, 2003 4:44:01 AM]

Share this post

Link to post
Share on other sites
Have you tried using an average for your dtime? It smoothes out most small jerks.

In pseudocode

delta_time = CurrentTime - Previoustime;

smooth_time = smooth_time*20 + delta_time;
smooth_time = smooth_time / 21;


Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!