I understand there is a usleep command in bash. Is this a "busy" or "blocking" sleep? Or will this yield time to other processes?
closed as off-topic by mdpc, Ward - Reinstate Monica♦, Tero Kilkanen, HBruijn Sep 30 '16 at 6:31
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions on Server Fault must be about managing information technology systems in a business environment. Home and end-user computing questions may be asked on Super User, and questions about development, testing and development tools may be asked on Stack Overflow." – mdpc, Ward - Reinstate Monica, Tero Kilkanen, HBruijn
This probably don't really belong on Server Fault (though I'm not sure which site it would belong on), but here's an answer anyway:
The bash shell does not have a builtin
usleep command (nor does it have a builtin
sleep is a standard program on Unix systems and is available regardless of which shell you're running.
usleep appears to be a program that was written by people at RedHat and might only be present in RedHat-related distributions (RHEL and derivatives; Fedora). It doesn't appear to be available in Debian.
In any case,
usleep use the standard
usleep() system calls, which pause program execution for the specified amount of time (making them "blocking"), and use no CPU time during their sleep (making them not "busy").
 The amount of time isn't actually guaranteed to be precisely what was requested, because of the way the kernel scheduler works. The usual guarantee is that it will sleep for at least the requested time. This isn't an issue for integer
sleep() durations, because the variance will be much less than a second, but
usleep() durations (and fractional
sleep() durations) might not end up being exact.
There is no
usleep command in bash.
usleep: command not found on bash 4.3.11 and nothing like that mentioned in the changelog ...