zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org
Subject: Re: [RFC] Millisecond and microsecond specifiers for TIMEFMT
Date: Wed, 13 Dec 2017 18:01:52 +0000	[thread overview]
Message-ID: <20171213180152.0af7a27f@ntlworld.com> (raw)
In-Reply-To: <6A9332CC-D501-4B1C-9347-92D0E87E45D7@dana.is>

On Mon, 11 Dec 2017 19:58:41 -0600
dana <dana@dana.is> wrote:
> I am often interested in getting sub-second-precision timing on shell
> commands, but the `time` built-in doesn't offer this (not really,
> anyway). I can kind of work around it by writing a function that
> fiddles with SECONDS, but my function doesn't have the fancy syntax
> support that `time` has, which makes it inconvenient for measuring
> some things.

You don't need to fiddle with SECONDS beyond turning it into floating
point,

typeset -F SECONDS

at which point it's just a question of subtraction, which isn't usually
regarded as particularly problematic.

> What i'd really like is if TIMEFMT supported sequences for milliseconds and
> microseconds.
> 
> I had a look and it really does seem quite simple to implement. How would you
> feel about something like the change below?

Can't see any obvious problem with this.  Just needs documenting.

pws


  reply	other threads:[~2017-12-13 18:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-12  1:58 dana
2017-12-13 18:01 ` Peter Stephenson [this message]
2017-12-14  2:49   ` dana
2017-12-14 10:01     ` Teubel György

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=20171213180152.0af7a27f@ntlworld.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).