SLEEP - go to sleep for a while.

(Slightly different from UNIX function)


unsigned sleep();
diff = sleep( howlong );


unsigned howlong;
is the number of seconds you want to sleep.
unsigned diff;
is the requested sleep time minus the actual sleep time, if "sleep" did not sleep as long as requested. If "sleep" slept longer, "diff" is zero.


When "sleep" is executed, the current program will be suspended from execution for "howlong" seconds. The actual sleep time may be less than the requested length if the program is awoken prematurely by some kind of "signal". It may also be longer than the requested time if the load on the system delays your program from restarting exactly on time.


A call to "sleep" automatically flushes buffered output to all terminals. Contrast this with


which flushes buffered output to all output streams, whether or not they're terminals.

See Also:

expl c lib fflush

expl nsc lib fflush

Copyright © 1996, Thinkage Ltd.