It's in milliseconds, but of course all a sleep function can do is
guarantee a MINIMUM sleeping time. In case other processes gets scheduled
to run, the sleeping process might have to wait slightly longer than the
specified time interval.
However, it is extremely rare that you get more than a couple of tenth of
seconds extra delay before being allowed to run. Was there any problem
recompiling the application between the test runs?
For long delays, you can just specify larger delay numbers until you reach
the numerical limit of the input parameter. For even longer delays, you
must do a loop with multiple sleep calls.
/Per W
On Fri, 13 Dec 2002 we...@ha... wrote:
> Hi all,
>
>
> Thkz for help. :))
>
> Now i'm using the correct header windows.h but count different from sleep()
> of linux. In linux it count in seconds... :)
>
> And here ?? I done a sample example:
>
> #include <stdio.h>
> #include <windows.h>
>
> int main(){
>
> Sleep(46000);
>
> return(0);
> }
>
> And it ruuning more or less 45 seconds... i tryed change this values to
> 42000, 43000, ... and it appear running always near 45 seconds.... :/
>
> How to count for example 1 minute with this sleep() function ??
>
> And 15 minutes ??
>
> Is it precision ??
>
> Thkz a lot.
>
> Best Regards.
>
> [ ]'s
>
>
|