Message-ID: From: Shawn Hargreaves To: djgpp AT delorie DOT com Subject: SV: too slow to be true: rest_callback . Date: Thu, 3 Feb 2000 12:28:01 -0000 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" Reply-To: djgpp AT delorie DOT com Erik Anell writes: > int rest=0; > void foo(void) > { > int time=1; > if (!rest) > { > rest=1; > rest_callback(time, foo); > rest=0; > } > } This code seems very strange to me: what exactly are you trying to do here? I have a feeling that there is probably a simpler way, so tell us what your actual objective is, and then someone can probably suggest how you might get there. >> 'time' is not how many times to run it, it is how LONG to run it, >> so rest_callback(1, foo) should take about 0.001 seconds regardless >> of the speed of foo, (as long as it is reasonably speedy), because >> it is being called many times. > > I am aware of that. That's why I think one millisecond wouldn't last > for half a second or something in that style... Half a second sounds unlikely to me, but you should be aware that Allegro timers aren't perfectly accurate: in particular under win9x you only have 5ms resolution. If you really are getting much more than a 5ms error, please give some more details about your problem, in particular which version of Allegro, what OS you run under, and a small example code (but complete, so we can compile and run it) that demonstrates your trouble. Shawn Hargreaves.