There is a routine "wait" in my oxutils package which might be useful.
See
http://www.tinbergen.nl/~cbos/software/oxutils.html
for the package or
http://www.tinbergen.nl/~cbos/packages/oxutils/doc/oxutils.html#wait
for the description of the function.
As an example:
> #include <oxstd.h>
> #include <packages/oxutils/oxutils.h>
>
> main()
> {
> println ("Do something...");
>
> // Wait 2 seconds
> wait(2);
>
> println ("Do something else...");
>
> // Wait until return is pressed
> wait(-1);
> }
might do what you wanted.
And indeed, on Linux there is a 'sleep' command behind it, on Windows it
uses an ugly hack at the moment of doing stupid computations for nothing
until sufficient time passed.
Greetings,
Charles
|