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

Re: Bug: time doesn't work on builtins



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