On Mon, 15 May 2023 12:36:20 +0300, Andrei Borzenkov <arvidjaar@gmail.com> wrote:
On Mon, May 15, 2023 at 12:23 PM Per Jessen <per@opensuse.org> wrote:
GNU sleep supports fractional intervals so "usleep 1" == "sleep 0.000001".
Heh, it does indeed! Pity it doesn't accept the suffixes ms and us too.
[...] I agree that additional suffixes would be useful.
Surprise! Instead of "ms" and "us", use "e-3" and "e-6". [1] So if you want to use integers to specify sub-second values, you're in luck. But, you can also use full exponential notation and follow it with an optional s|m|h|d suffix (for seconds|minutes|hours|days): sleep 567.89e-6h (for 2.044404 seconds) Now I've noticed that "info '(coreutils) sleep invocation'" also describes the exponential notation form. [1] https://www.gnu.org/software/coreutils/manual/coreutils.html#sleep-invocatio... -- Robert Webb