Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug: time doesn't work on builtins
- X-seq: zsh-workers 53065
- From: "Jun. T" <takimoto-j@xxxxxxxxxxxxxxxxx>
- Cc: zsh-workers@xxxxxxx
- Subject: Re: Bug: time doesn't work on builtins
- Date: Wed, 4 Sep 2024 23:32:43 +0900
- Archived-at: <https://zsh.org/workers/53065>
- In-reply-to: <CAH+w=7ZpU-QCFAfPYvBFQvUnfekV35c3B_j7eoWvo8MokJ0Ncw@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAA=-s3w0wsH7xkS58JS0AbGdOoihYxq+cKEpVomFU_f1_w-ynQ@mail.gmail.com> <CAH+w=7a3BuQnPMa5YEy8n8ZNSNNoYNKLL9Aki5iCSPKbTyn5eQ@mail.gmail.com> <CAA=-s3z3YMho0a4A3H4h3o75oY1fR36w2zz83zQKjyPi3mSTpQ@mail.gmail.com> <CAH+w=7ZZ3frU9OjpkOmHzvL6Ws0YQPE=_JK+izmRR+gEcvSsDg@mail.gmail.com> <CAH+w=7ZpU-QCFAfPYvBFQvUnfekV35c3B_j7eoWvo8MokJ0Ncw@mail.gmail.com>
> 2024/09/04 9:27, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Fri, Aug 16, 2024 at 12:20 PM Bart Schaefer
> <schaefer@xxxxxxxxxxxxxxxx> wrote:
>>
>> Let's try this.
>
> Any comment on the patch?
The followings still give no time statistics:
% time x=1
% time x=$(date)
The following works:
% x=0; time for ((i=1; i<=10000; ++i)); do let 'x+=i'; done; echo $x
shell 0.03s user 0.01s system 99% cpu 0.036 total
children 0.00s user 0.00s system 0% cpu 0.036 total
50005000
But if "let 'x+=i' is replaced by "((x+=i))"
% x=0; time for ((i=1; i<=10000; ++i)); do ((x+=i)); done; echo $x
0
The for loop is not executed, and the time statistics is not output.
This happens also without the patch time-builtins.txt.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author