sleep
raw OCR
Suspends execution for an interval (seconds).
Defined in header <dos.h>
Syntax
#include <dos.h>
void sleep(unsigned seconds);
Portability
| DOS | UNIX | Windows | ANSI C | C++ only |
|---|---|---|---|---|
| ■ | ■ |
Remarks
With a call to sleep, the current program is suspended from execution for the number of seconds specified by the argument seconds. The interval is only accurate to the nearest hundredth of a second or the accuracy of the DOS clock, whichever is less accurate.
Return value
None.
See also
Example
#include <dos.h>
#include <stdio.h>
int main(void)
{
int i;
for (i=l; i<5; i++) {
printf ("Sleeping for %d seconds\n", i)
sleep(i);
}
return 0;
Differences from modern implementations
Nothing recorded yet.
Modern references
These are search links, not yet checked by hand.
Stable link: /3.1/dos.h/sleep/
· short form /3.1/sleep/