From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2407 invoked by alias); 28 Jun 2012 22:01:54 -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: 30544 Received: (qmail 12499 invoked from network); 28 Jun 2012 22:01:52 -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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <120628150035.ZM28226@torch.brasslantern.com> Date: Thu, 28 Jun 2012 15:00:35 -0700 In-reply-to: Comments: In reply to Mikael Magnusson "Re: typeset -F3 SECONDS doesn't work the first time" (Jun 28, 8:11pm) References: <120627105032.ZM25924@torch.brasslantern.com> <120628095403.ZM27189@torch.brasslantern.com> <120628110658.ZM27841@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh workers Subject: Re: typeset -F3 SECONDS doesn't work the first time MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Jun 28, 8:11pm, Mikael Magnusson wrote: } } Right, the fractional part was what I wanted to show. sleep in both } pipelines can sleep for subsecond intervals, but afaik there's no } builtin sleep command in zsh. Hrm, dunno what I was thinking there except that I couldn't figure out why you used =sleep in one example but not the other. In any case init.c:setupvals() loads the shtimer global directly to initialize SECONDS and then a bit later calls createparamtable() to copy the environment, which goes through params.c:intsecondssetfn() which resets shtimer.tv_sec and zeroes shtimer.tv_usec. So this probably has to do with rounding error when converting shtimer to double by typecast and division in params.c:floatsecondsgetfn(). Same thing happens without the code snippet from workers/30540 so that's not involved.