<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p>Hi Lauren,</p>
<p><br>
</p>
<p>thanks for the patch! :-) Just as a comprehension question, what are the rounding errors you are talking about and why did you insert a #<span>roundTo: in the test</span>?</p>
<p><br>
</p>
<p>Best,</p>
<p>Christoph</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von commits@source.squeak.org <commits@source.squeak.org><br>
<b>Gesendet:</b> Donnerstag, 3. März 2022 08:46:46<br>
<b>An:</b> squeak-dev@lists.squeakfoundation.org<br>
<b>Betreff:</b> [squeak-dev] The Inbox: Chronology-Tests-lrnp.31.mcz</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">A new version of Chronology-Tests was added to project The Inbox:<br>
<a href="http://source.squeak.org/inbox/Chronology-Tests-lrnp.31.mcz">http://source.squeak.org/inbox/Chronology-Tests-lrnp.31.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Chronology-Tests-lrnp.31<br>
Author: lrnp<br>
Time: 3 March 2022, 12:46:42.775073 am<br>
UUID: 437b3938-ef51-494d-9dee-ba89baa669bb<br>
Ancestors: Chronology-Tests-ct.30<br>
<br>
adjust margin of error for millisecond timing<br>
<br>
Given that the shortest measurable interval is 1 ms, rounded, allow up to 2 milliseconds over or under for a combination of rounding and delays introduced by taking measurements.<br>
<br>
This makes the busyWait test harder to pass unless the millisecond precision prescribed by Delay's comment applies to the current image. If the prescription applies, the test will pass more reliably in case of rounding errors.<br>
<br>
=============== Diff against Chronology-Tests-ct.30 ===============<br>
<br>
Item was changed:<br>
  ----- Method: DurationTest>>testBusyWait (in category 'tests') -----<br>
  testBusyWait<br>
         <br>
         | duration start elapsed |<br>
         duration := Duration milliSeconds: 1.<br>
         start := DateAndTime now.<br>
         <br>
         1000 timesRepeat: [duration busyWait].<br>
+        elapsed := DateAndTime now - start roundTo: duration.<br>
-        elapsed := DateAndTime now - start.<br>
         <br>
+        self assert: elapsed >= (duration * 998).<br>
+        self assert: elapsed <= (duration * 1002).!<br>
-        self assert: elapsed >= (duration * 1000).<br>
-        self assert: elapsed <= (duration * 1000 * 2).!<br>
<br>
<br>
</div>
</span></font>
</body>
</html>