Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug: time doesn't work on builtins
- X-seq: zsh-workers 53071
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Jun T <takimoto-j@xxxxxxxxxxxxxxxxx>
- Cc: zsh-workers@xxxxxxx
- Subject: Re: Bug: time doesn't work on builtins
- Date: Fri, 6 Sep 2024 12:13:19 -0700
- Archived-at: <https://zsh.org/workers/53071>
- In-reply-to: <CEAB70F9-A50B-4A2E-90B8-A8017E921EA7@kba.biglobe.ne.jp>
- 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> <20C9A9EE-49A5-4A58-AA00-136A5D221331@kba.biglobe.ne.jp> <CAH+w=7aKEm0t37Df9kS0KEYXrp607zX+1cV3xtAJ9bbjfXgXsw@mail.gmail.com> <CEAB70F9-A50B-4A2E-90B8-A8017E921EA7@kba.biglobe.ne.jp>
On Fri, Sep 6, 2024 at 2:52 AM Jun T <takimoto-j@xxxxxxxxxxxxxxxxx> wrote:
>
> % time eval 'external command'
> % time . ./script # script runs external command
>
> I think it's better to pass &chti always.
OK.
> [2] Time spent in prefork() is not included in the statistics.
I believe that's fixable by always calling shelltime(...,0) when
Z_TIMED but then only calling shelltime(...,1) when is_cursh is
determined later.
Remaining question is whether stats should be printed on error cases,
e.g., "no such builtin":
time builtin nosuch $(long running command)
That means sticking in a few more calls to shelltime() in front of
early return statements.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author