Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: typeset -F3 SECONDS doesn't work the first time



On 28/06/2012, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:

> Aside:  Exporting SECONDS doesn't do what you might think.  The value at
> the time of the export is enshrined in the environment and never changes,
> and is thereafter the starting clock for newly-started shells.

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


-- 
Mikael Magnusson



Messages sorted by: Reverse Date, Date, Thread, Author