From: "Mark J. Reed" <markjreed@gmail.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: Bug: time doesn't work on builtins
Date: Thu, 15 Aug 2024 18:08:35 -0400 [thread overview]
Message-ID: <CAA=-s3z3YMho0a4A3H4h3o75oY1fR36w2zz83zQKjyPi3mSTpQ@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7a3BuQnPMa5YEy8n8ZNSNNoYNKLL9Aki5iCSPKbTyn5eQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1096 bytes --]
Absent a rewrite of the functionality to actually work on builtins, maybe
it could be modified to output a message about *time* only being supported
for external commands?
On Thu, Aug 15, 2024 at 2:52 PM Bart Schaefer <schaefer@brasslantern.com>
wrote:
> On Thu, Aug 15, 2024 at 6:15 AM Mark J. Reed <markjreed@gmail.com> 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.
>
--
Mark J. Reed <markjreed@gmail.com>
[-- Attachment #2: Type: text/html, Size: 1706 bytes --]
next prev parent reply other threads:[~2024-08-15 22:09 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-15 13:15 Mark J. Reed
2024-08-15 18:52 ` Bart Schaefer
2024-08-15 22:08 ` Mark J. Reed [this message]
2024-08-16 19:20 ` Bart Schaefer
2024-09-04 0:27 ` Bart Schaefer
2024-09-04 14:32 ` Jun. T
2024-09-05 17:29 ` Jun. T
2024-09-05 23:37 ` Bart Schaefer
2024-09-06 9:41 ` Jun T
2024-09-06 0:10 ` Bart Schaefer
2024-09-06 9:52 ` Jun T
2024-09-06 19:13 ` Bart Schaefer
2024-09-14 2:10 ` PATCH: " Bart Schaefer
2024-09-20 7:46 ` Oliver Kiddle
2024-09-22 0:59 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAA=-s3z3YMho0a4A3H4h3o75oY1fR36w2zz83zQKjyPi3mSTpQ@mail.gmail.com' \
--to=markjreed@gmail.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).