Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: miscomputation of total time?



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@xxxxxxxxxx> - 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)




Messages sorted by: Reverse Date, Date, Thread, Author