zsh-workers
 help / color / mirror / Atom feed
* miscomputation of total time?
@ 2021-04-30  9:50 Vincent Lefevre
  2021-04-30 10:25 ` Vincent Lefevre
  0 siblings, 1 reply; 2+ messages in thread
From: Vincent Lefevre @ 2021-04-30  9:50 UTC (permalink / raw)
  To: zsh-workers

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?

Here are the 370 values after sorting them:

17
17
18
18
18
18
18
18
19
19
19
19
19
19
19
19
19
19
20
20
20
20
20
20
20
20
20
21
21
21
21
21
21
21
21
21
21
21
21
21
22
22
22
22
22
22
22
22
22
22
22
22
22
23
23
23
23
23
23
23
23
23
23
23
23
23
23
23
23
23
23
24
24
24
24
24
24
24
24
24
24
24
24
24
24
24
24
25
25
25
25
25
25
25
25
25
25
25
25
25
25
26
26
26
26
26
26
26
26
26
26
26
26
26
26
26
26
26
26
26
26
27
27
27
27
27
27
27
27
27
27
27
27
27
27
27
27
27
27
27
27
28
28
28
28
28
28
28
28
28
28
28
28
28
28
28
28
29
29
29
29
29
29
29
29
29
30
30
30
30
30
30
30
30
30
30
31
31
31
31
31
31
31
31
31
31
31
31
31
31
32
32
32
32
32
32
32
32
32
32
32
32
32
32
32
32
32
32
32
33
33
33
33
33
33
33
33
33
33
33
34
34
34
34
34
34
34
34
34
34
34
34
34
34
34
34
34
35
35
35
35
35
35
35
35
35
35
35
35
35
35
36
36
36
36
36
36
36
36
36
36
36
37
37
37
37
37
37
37
37
37
37
37
37
37
37
38
38
38
38
38
38
38
39
39
39
39
39
40
40
40
40
40
40
40
41
41
41
41
42
42
43
43
43
43
43
43
43
44
44
45
45
45
46
46
46
46
47
47
47
47
47
47
47
47
48
48
48
49
49
50
50
51
52
52
52
52
53
53
54
54
55
57
58
58
58
59
60
60
62
62
64
65
66
67
67
68
69
72
73
77
83
83
85
86
86
87
91
97
99

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: miscomputation of total time?
  2021-04-30  9:50 miscomputation of total time? Vincent Lefevre
@ 2021-04-30 10:25 ` Vincent Lefevre
  0 siblings, 0 replies; 2+ messages in thread
From: Vincent Lefevre @ 2021-04-30 10:25 UTC (permalink / raw)
  To: zsh-workers

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)


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-30 10:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-30  9:50 miscomputation of total time? Vincent Lefevre
2021-04-30 10:25 ` Vincent Lefevre

zsh-workers

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 \
		zsh-workers@zsh.org
	public-inbox-index zsh-workers

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.workers


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

	https://git.vuxu.org/mirror/zsh/

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