usleep

Suspends execution for an interval.

Format

#include  <unistd.h>

int usleep  (unsigned int mseconds);

Arguments

mseconds
The number of microseconds to suspend execution for.

Description

This function suspends the current process from execution for the number of microseconds specified by the mseconds argument. This argument must be less than 1,000,000. However, if its value is 0, then the call has no effect.

There is one real-time interval timer for each process. The usleep function does not interfere with a previous setting of this timer. If the process set this timer before calling usleep and if the time specified by mseconds equals or exceeds the interval timer's prior setting, then the process is awakened shortly before the timer was set to expire.

Return Values
Indicates success. 
-1  Indicates an error occurred; errno is set to EINVAL.  


Previous Page | Next Page | Table of Contents | Index