From: Phil Pennock <zsh-workers+phil.pennock@spodhuis.org>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh-workers@zsh.org
Subject: Re: sleep $floatval
Date: Sun, 1 Sep 2013 01:16:17 -0700 [thread overview]
Message-ID: <20130901081617.GA65885@redoubt.spodhuis.org> (raw)
In-Reply-To: <130901004527.ZM27352@torch.brasslantern.com>
On 2013-09-01 at 00:45 -0700, Bart Schaefer wrote:
> If $SleepDuration can be < 1, don't you want
>
> usleep $((SleepDuration * 1.0e+6))
I don't have a usleep(1) command. I do have a BSD sleep(1) command
which takes fractional seconds, both on FreeBSD and MacOS, and the
Ubuntu systems I see have a sleep(1) which does the same, and appears to
be from GNU coreutils.
It appears that the GNU coreutils variant correctly parses
"3.000000000e-01" and sleeps for 0.3 seconds, instead of 3 seconds.
> The current behavior isn't problematic enough to have caused POSIX, bash,
> et al., to redefine sleep as a builtin, and it's not a problem I've ever
> encountered myself, but ...
I think POSIX still doesn't specify any support for non-integral
sleep(1) durations, right?
> If zsleep, then it could be a new module or be added to zsh/datetime.
Am reconsidering in light of this being purely a BSD sleep(1) bug. Hrm.
Thanks,
-Phil
next prev parent reply other threads:[~2013-09-01 8:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-31 23:47 Phil Pennock
2013-09-01 7:45 ` Bart Schaefer
2013-09-01 8:16 ` Phil Pennock [this message]
2013-09-01 17:29 ` Peter Stephenson
2013-09-02 2:33 ` Phil Pennock
2013-09-02 18:09 ` Bart Schaefer
2013-09-03 3:05 ` Phil Pennock
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130901081617.GA65885@redoubt.spodhuis.org \
--to=zsh-workers+phil.pennock@spodhuis.org \
--cc=schaefer@brasslantern.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).