[squeak-dev] The Inbox: Chronology-Tests-lrnp.31.mcz

Lauren Pullen drurowin at gmail.com
Mon Mar 28 18:11:27 UTC 2022


Hi Christoph,

On 3/25/22 17:57, Thiede, Christoph wrote:
> thanks for the patch! :-) Just as a comprehension question, what are the rounding errors you are talking about and why did you insert a #roundTo: in the test?
With #busyWait the timing isn't perfect, so the actual delay is 1
millisecond plus or minus some nanoseconds.  Those nanosecond
differences are the round-off error, and they can add up to be a
millisecond or more up and down*.

The #roundTo: makes passing duration be
	997.5 <= elapsed < 1002.5
instead of
	998.0 <= elapsed <= 1002.0

I was getting a significant number of 997.9999 elapsed times out of
testing so I put in the #roundTo:.

*  While I was testing, a good 50% of the elapsed times were between 998
and 999 milliseconds, over the course of around 1000 iterations.  The
minimum was the strangely low 990 milliseconds.


More information about the Squeak-dev mailing list