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

Re: Bug: time doesn't work on builtins



> 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