|
From: Earnie B. <ear...@ya...> - 2002-01-11 14:49:57
|
fabrice ilponse wrote:
>
> >
> >
> >>The following code is supposed to wait for 2 seconds,
> >>but it only waits for 2 milliseconds under Mingw (mingw-1.1.tar.gz with
> >>the latest runtime and w32api). With other gcc platforms (e.g., Cygwin,
> >>Linux) it waits for 2 seconds.
> >>
> >>#include <unistd.h>
> >>int main ()
> >>{
> >> sleep ( 2 );
> >>
> >
> >Modify that to 2*1000 and it'll wait 2 seconds.
> >
> Yes but that's not portable. :(
> Is there a way to overide sleep so it acts like under unix?
>
#if defined(_WIN32) && ! defined (__unix__)
sleep (2*1000);
#else
sleep (2);
#endif
Earnie.
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
|