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

Re: Timing function execution



On Sat, Nov 6, 2021 at 11:35 AM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> Glancing through builtin.c, "times" (based on library times(3)) may be
> the answer?
>
> I had entirely forgotten the existence of that builtin.

And (with apologies for the multiple follow-ups) I had also forgotten
that you can run "time" with no arguments:

% time; foo; time
shell  0.03s user 0.01s system 0% cpu 11:05.07 total
children  1.30s user 0.17s system 0% cpu 11:05.07 total
hello
shell  0.03s user 0.01s system 0% cpu 11:06.07 total
children  1.30s user 0.17s system 0% cpu 11:06.07 total




Messages sorted by: Reverse Date, Date, Thread, Author