From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: Ram Rachum <ram@rachum.com>, zsh-workers@zsh.org
Subject: Re: `time` doesn't say seconds
Date: Tue, 21 Nov 2023 09:25:11 +0000 [thread overview]
Message-ID: <9658AE7C-58D0-43C7-89E2-F03090EECB06@ntlworld.com> (raw)
In-Reply-To: <CAH+w=7YvLy1Tz7C2Dns8Zk2dwjZb-co4QBnvnMBhQvCjNrJmMw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1338 bytes --]
> On 10/11/2023 17:26 GMT Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Fri, Nov 10, 2023 at 5:25 AM Ram Rachum <ram@rachum.com> wrote:
> >
> > If I understand correctly, the 11.230 number is 11.230 seconds, but
> > for some reason it doesn't have "s" after it like 11.41s and
> > 0.90s. I think that it should.
>
> TIMEFMT='%J %U user %S system %P cpu %E total'
>
> The default format instead uses %*E which drops the trailing "s" and
> uses HH:MM:SS.TTT instead, but the HH and MM are also dropped when
> zero.
I meant to follow up to this one.
It could be made more consistent by putting back the s in that last
case, though. Without the colon indicating the meaning of the numbers
(though MM:SS and HH:MM are also a bit ambiguous) this probably makes
more sense.
I don't know if anyone is likely to be automatically matching the
current format? Given the variability of this element presumably not.
diff --git a/Src/jobs.c b/Src/jobs.c
index a3b9f667a..bb9246837 100644
--- a/Src/jobs.c
+++ b/Src/jobs.c
@@ -730,7 +730,7 @@ printhhmmss(double secs)
else if (mins)
fprintf(stderr, "%d:%05.2f", mins, secs);
else
- fprintf(stderr, "%.3f", secs);
+ fprintf(stderr, "%.3fs", secs);
}
static void
[-- Attachment #2: Type: text/html, Size: 1618 bytes --]
next prev parent reply other threads:[~2023-11-21 9:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-10 13:24 Ram Rachum
2023-11-10 17:26 ` Bart Schaefer
2023-11-10 17:28 ` Ram Rachum
2023-11-10 17:31 ` Bart Schaefer
2023-11-21 9:25 ` Peter Stephenson [this message]
2023-11-22 3:36 ` Bart Schaefer
2023-11-22 11:15 ` Peter Stephenson
2023-11-22 20:23 ` Mark J. Reed
2023-11-22 22:40 ` 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=9658AE7C-58D0-43C7-89E2-F03090EECB06@ntlworld.com \
--to=p.w.stephenson@ntlworld.com \
--cc=ram@rachum.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).