delay

suspend a process for a given length of time

Synopsis:

#include <i86.h>
unsigned int delay( unsigned int milliseconds );

Description:

The delay() function suspends the calling process until:

The suspension time may be greater than the requested amount, due to the scheduling of other, higher priority activity by the system.

Returns:

The delay() function returns zero if the full time specified was completed; otherwise it returns the number of milliseconds unslept if interrupted by a signal.

Errors:

When an error has occurred, errno contains a value that indicates the type of error:

EAGAIN
No timer resources were available to satisfy the request.

See also:

alarm(), errno, sleep()

Examples:

#include <i86.h>

void main()
  {
    sound( 200 );
    delay( 500 );  /* delay for 1/2 second */
    nosound();
  }

Classification:

WATCOM

Systems:

All (except Netware, DOS/PM)