← 返回命令列表

Linux command

usleep 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Sleep microseconds

usleep [1000000]

Sleep 100ms

usleep [100000]

Sleep 1ms

usleep [1000]

说明

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.

FAQ

What is the usleep command used for?

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.

How do I run a basic usleep example?

Run `usleep [1000000]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

Where can I find more usleep examples?

This page includes 3 examples for usleep, plus related commands for nearby Linux tasks.