From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13064 invoked by alias); 1 Sep 2013 08:16:38 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 31680 Received: (qmail 19803 invoked from network); 1 Sep 2013 08:16:23 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at spodhuis.org does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d201210; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=Y7+g9dzZNlW8TJUWHwdU48br7Khc0uxJBLFKbczvCCk=; b=BUy0KpIJDdz21iEjoYS2D590TCAe8mdPROfQmEjfhmFgERXU6QDbfQgk5hOl0ZcJmoWsm7OP7gDqRysRxWujB9hi2ElZUyGUCj7XiKQF5vG3wcHXZ7eiXR/DZcez0hzpUl70bwVAvpEvM+GkjPGttsRNKLKeIKAVQbacqEVROk8=; Date: Sun, 1 Sep 2013 01:16:17 -0700 From: Phil Pennock To: Bart Schaefer Cc: zsh-workers@zsh.org Subject: Re: sleep $floatval Message-ID: <20130901081617.GA65885@redoubt.spodhuis.org> Mail-Followup-To: Bart Schaefer , zsh-workers@zsh.org References: <20130831234733.GA83723@redoubt.spodhuis.org> <130901004527.ZM27352@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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