LinuxCommandLibrary

usleep

Pause execution for microseconds

TLDR

Sleep microseconds

$ usleep [1000000]
copy
Sleep 100ms
$ usleep [100000]
copy
Sleep 1ms
$ usleep [1000]
copy

SYNOPSIS

usleep microseconds

DESCRIPTION

usleep pauses execution for a specified number of microseconds (millionths of a second). It provides finer timing granularity than the standard sleep command, which traditionally only accepted whole seconds.
The command takes a single argument representing the number of microseconds to pause. For example, usleep 500000 pauses for half a second, and usleep 1000 pauses for one millisecond.
On modern Linux systems, usleep is largely obsolete because GNU sleep accepts fractional seconds (e.g., sleep 0.5). The usleep command was historically provided by the initscripts package and may not be available on all distributions.

PARAMETERS

microseconds

Time to sleep.

CAVEATS

Deprecated on many systems. Use sleep instead. Not in all distros.

HISTORY

usleep was provided by initscripts package for microsecond sleep. Modern sleep accepts fractional seconds.

SEE ALSO

sleep(1), nanosleep(2)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community