Message-ID: <8D53104ECD0CD211AF4000A0C9D60AE30136623C@probe-2.acclaim-euro.net> From: Shawn Hargreaves To: djgpp AT delorie DOT com Subject: Simple timer question... Date: Tue, 4 May 1999 11:10:09 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.0.1460.8) Content-Type: text/plain Reply-To: djgpp AT delorie DOT com Unigni writes: > I was wondering how to get a timer in milliseconds, so that > each game loop would take 100 milliseconds -- NOT doing > stuff and *then* waiting 100 milliseconds. Several people have already commented that you can use uclock() for this, but if you are using Allegro, that isn't such a great plan since Allegro will probably already be using its own timer module (that is needed for things like mouse input and MIDI playback, and can conflict with the libc time functions). Using Allegro, you can either check the global retrace_count variable, or install a timer callback function of your own. The ex7 example program shows how to do this, and for examples of using them to control game speed, look at the demo game and the Allegro FAQ. Shawn Hargreaves.