What Super Vegeta said.
But since you're using Allegro, you should use al_rest (instead of Sleep or Delay), and al_retrace_count (instead of getMSecs, and note that it doesn't count in milliseconds). Don't forget to initialize the timer (call to al_install_timer on initialization).
Bookmarks