[Previous]
[Contents]
[Next]

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:


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

Returns:

0 if the full time specified was completed, or 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.

Examples:

#include <i86.h>

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

Classification:

WATCOM
Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

alarm(), errno, sleep()


[Previous]
[Contents]
[Next]