zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org
Subject: Re: `time` doesn't say seconds
Date: Wed, 22 Nov 2023 11:15:13 +0000 (GMT)	[thread overview]
Message-ID: <1580746586.762329.1700651713916@mail.virginmedia.com> (raw)
In-Reply-To: <CAH+w=7bNoi8WwN8X8MzApce99UkOhATSRmTfxkmnHh+3APh6AA@mail.gmail.com>

> On 22/11/2023 03:36 GMT Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Tue, Nov 21, 2023 at 1:25 AM Peter Stephenson
> <p.w.stephenson@ntlworld.com> wrote:
> >
> > I don't know if anyone is likely to be automatically matching the
> > current format?  Given the variability of this element presumably not.
> 
> The doc should be updated, though.  It specifies the default without
> the "s".  Your patch also alters the definition of %*E in the value of
> TIMEFMT.

This is the only place I can see with late level of detail.

pws

--- a/Doc/Zsh/params.yo
+++ b/Doc/Zsh/params.yo
@@ -1721,7 +1721,8 @@ endsitem()
 A star may be inserted between the percent sign and flags printing time
 (e.g., `tt(%*E)'); this causes the time to be printed in
 `var(hh)tt(:)var(mm)tt(:)var(ss)tt(.)var(ttt)'
-format (hours and minutes are only printed if they are not zero).
+format.  Hours and minutes are only printed if they are not zero;
+an `s' is appended if they are both zero.
 Alternatively, `tt(m)' or `tt(u)' may be used (e.g., `tt(%mE)') to produce
 time output in milliseconds or microseconds, respectively.
 )
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


  reply	other threads:[~2023-11-22 11:15 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
2023-11-22  3:36     ` Bart Schaefer
2023-11-22 11:15       ` Peter Stephenson [this message]
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=1580746586.762329.1700651713916@mail.virginmedia.com \
    --to=p.w.stephenson@ntlworld.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).