Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug: time doesn't work on builtins
- X-seq: zsh-workers 53037
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: "Mark J. Reed" <markjreed@xxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: Bug: time doesn't work on builtins
- Date: Thu, 15 Aug 2024 11:52:20 -0700
- Archived-at: <https://zsh.org/workers/53037>
- In-reply-to: <CAA=-s3w0wsH7xkS58JS0AbGdOoihYxq+cKEpVomFU_f1_w-ynQ@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAA=-s3w0wsH7xkS58JS0AbGdOoihYxq+cKEpVomFU_f1_w-ynQ@mail.gmail.com>
On Thu, Aug 15, 2024 at 6:15 AM Mark J. Reed <markjreed@xxxxxxxxx> wrote:
>
> Any attempt to time a builtin generates no output whatsoever. No timings, no error message.The timed command executes in the current shell and has its usual side-effects, but the time itself does nothing.
This was last discussed in users/28740 and subsequent thread ...
>> The OS facility that reports time statistics only works for a parent
>> process to read the stats of a child. To work on builtins, we'd have
>> to rewrite that internally
That isn't quite accurate ... what we'd have to do is call RUSAGE_SELF
both before and after the builtin and subtract the former from the
latter, there's no (other) facility to get only the internal time
delta.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author