delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/02/03/09:19:53

Message-ID: <F77915E7F086D31197F4009027CC81C9259F33@probe-2.as-london.acclaim.com>
From: Shawn Hargreaves <SHargreaves AT acclaimstudios DOT co DOT uk>
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)
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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019