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

Re: Bug: time doesn't work on builtins



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