From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 500 invoked by alias); 28 Jun 2012 18:07:33 -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: 30542 Received: (qmail 417 invoked from network); 28 Jun 2012 18:07:31 -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: <120628110658.ZM27841@torch.brasslantern.com> Date: Thu, 28 Jun 2012 11:06:58 -0700 In-reply-to: Comments: In reply to Mikael Magnusson "Re: typeset -F3 SECONDS doesn't work the first time" (Jun 28, 7:04pm) References: <120627105032.ZM25924@torch.brasslantern.com> <120628095403.ZM27189@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, 7:04pm, Mikael Magnusson wrote: } } Another aside: } % while =sleep 0.1; do zsh -c 'typeset -F4 SECONDS; echo $SECONDS'; } done | head -n 13|xargs } 0.0020 0.0020 0.0019 0.0019 0.0019 0.0023 0.0019 0.0013 0.0023 0.0020 } 0.0020 0.0019 0.0019 } but: } % while sleep 0.1; do SECONDS=15 zsh -c 'typeset -F4 SECONDS; echo } $SECONDS'; done | head -n 13 | xargs } 15.1560 15.2605 15.3650 15.4694 15.5738 15.6783 15.7827 15.8871 } 15.9916 15.0961 15.2004 15.3047 15.4091 I'm not sure what you're illustrating. Did you intend to switch from /bin/sleep to the builtin sleep in the second example? Does a value for sleep of less than 1 second even have any useful effect? OTOH, it doesn't seem to matter much to the output. I'm not sure where the fractional part of $SECONDS is coming from when an initial value is assigned.