On 2019-12-02 14:58, Stephane Chazelas wrote: > With GNU coreutils sleep (and ksh93's builtin but not that of > bash or mksh) one can add a e-3 suffix to get miliseconds (and > e-6 for us and e-9 for ns)
Thanks for pointing that out. Regardless of whether we agree on supporting ms, us or ns now or later, the attached adds such already supported sub-second example to the documentation. Have a nice day, Berny
>From 7490e94aa7ea1ba50492e211fc415a6bda9de9ee Mon Sep 17 00:00:00 2001 From: Bernhard Voelker <[email protected]> Date: Sun, 8 Dec 2019 17:29:57 +0100 Subject: [PATCH] doc: add example to demonstrate sub-second sleep times * doc/coreutils.texi (sleep invocation): Add an example to demonstrate how to use the floating-point and the scientific notation to sleep for sub-second times, e.g. milli-, micro- and nanoseconds. Inspired by Stephane Chazelas in: https://lists.gnu.org/r/coreutils/2019-12/msg00005.html --- doc/coreutils.texi | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/coreutils.texi b/doc/coreutils.texi index 32ddba597..c52bb2dad 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -18248,6 +18248,13 @@ non-negative integer argument without a suffix, GNU @command{sleep} also accepts two or more arguments, unit suffixes, and floating-point numbers in either the current or the C locale. @xref{Floating point}. +For instance, the following could be used to @command{sleep} for +1 second, 234 milli-, 567 micro- and 890 nanoseconds: + +@example +sleep 1234e-3 567.89e-6 +@end example + The only options are @option{--help} and @option{--version}. @xref{Common options}. -- 2.24.0
