help / color / mirror / Atom feed
From: Vincent Lefevre <vincent@vinc17.net>
To: zsh-workers@zsh.org
Subject: Re: miscomputation of total time?
Date: Fri, 30 Apr 2021 12:25:58 +0200
Message-ID: <20210430102558.GA1183927@zira.vinc17.org> (raw)
In-Reply-To: <20210430095057.GA1181586@zira.vinc17.org>

On 2021-04-30 11:50:57 +0200, Vincent Lefevre wrote:
> I use REPORTTIME=60, and on a Debian 10 machine (I haven't tried on
> others) with zsh 5.7.1, I've noticed that the fraction of second in
> the total time (the 2 digits between the period and " total") is not
> random as expected: on the 370 runs in the past few months, I get a
> value always between 17 and 99. Moreover, values from 17 to 47 occur
> much more often than values from 48 to 99 (325 values vs 45).
> Statistically, these values should be random between 00 and 99.
> Is there an error in the computation of the total time?

Sorry, I think that I found the cause. I forgot that the process
in question was multithreaded, with a main thread waiting for the
others (even on this machine with 1 core). A check is done every
second with a "sleep 1", so that I think that the total time is
an integer number of seconds + some overhead.

Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

      reply	other threads:[~2021-04-30 10:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-30  9:50 Vincent Lefevre
2021-04-30 10:25 ` Vincent Lefevre [this message]

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210430102558.GA1183927@zira.vinc17.org \
    --to=vincent@vinc17.net \
    --cc=zsh-workers@zsh.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link


This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/zsh-workers

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 zsh-workers zsh-workers/ http://inbox.vuxu.org/zsh-workers \
	public-inbox-index zsh-workers

Example config snippet for mirrors.
Newsgroup available over NNTP:

code repositories for the project(s) associated with this inbox:


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git