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

Re: time command with shell builtins



On Mon, Jan 23, 2023 at 02:42:05PM +0100, Roman Perepelitsa wrote:
> On Mon, Jan 23, 2023 at 2:40 PM Dominik Vogt <dominik.vogt@xxxxxx> wrote:
> >
> > Is it possible to get timing statistics of shell builtins too?
> > Timing "echo" isn't very interesting, but timing loop constructs
> > would be:
> >
> >   $ time while foo; do bar done
>
> This:
>
>     % time ( while foo; do bar; done )

That wasn't really the question.  Of course I can time a loop by
writing a different command, or by putting it in a pipe or file.

  $ time echo foo | true

I just want to get timing statistics of loops either explicitly by
prepending "time" or implicitly with REPORTTIME.

Ciao

Dominik ^_^  ^_^

--

Dominik Vogt




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