Go to the first, previous, next, last section, table of contents.


usleep

Syntax

#include <unistd.h>

unsigned usleep(unsigned usec);

Description

This function pauses the program for usec microseconds. Note that, since usleep calls clock internally, and the latter has a 55-msec granularity, any argument less than 55msec will result in a pause of random length between 0 and 55 msec. Any argument less than 11msec (more precisely, less than 11264 microseconds), will always result in zero-length pause (because clock multiplies the timer count by 5). See section clock.

Return Value

The number of unslept microseconds (i.e. zero).

Portability

not ANSI, not POSIX

Example

usleep(500000);


Go to the first, previous, next, last section, table of contents.