_sleep

From RAD Studio
Jump to: navigation, search

Go Up to dos.h Index

Header File

dos.h

Category

Process Control Routines

Prototype

void _sleep(unsigned seconds);

Description

Suspends execution for an interval (seconds).

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 accurate only to the nearest hundredth of a second or to the accuracy of the operating system clock, whichever is less accurate.

Return Value

None.

Example

#include <dos.h>
#include <stdio.h>
int main(void)
{
   int i;
   for (i=1; i<5; i++)
   {
      printf("Sleeping for %d seconds\n", i);
      _sleep(i);
   }
   return 0;
}

Portability

POSIX Win32 ANSI C ANSI C++

+