Borland C++ reference

sleep

raw OCR

Suspends execution for an interval (seconds).

Defined in header <dos.h>

Syntax

#include <dos.h>
void sleep(unsigned seconds);

Portability

DOSUNIXWindowsANSI CC++ 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.