<div dir="ltr"><div class="gmail_extra">Hi Eliot,</div><div class="gmail_extra"><br></div><div class="gmail_extra">am I understanding correctly that (one of) your ideas is to have just one clock that &quot;drifts&quot; towards wall clock time? How fast would it drift? I agree this would be neat for a local image, but what if someone from Japan sends me their image (happened to me just last week) and wants me to check something in it? Will the in-image clock run slow for a few hours until my timezone has caught up with Japan?</div><div class="gmail_extra"><br></div><div class="gmail_extra">Also, this sounds like a lot of logic to have in the VM and a source of possible confusion for the user - they would have to know to use the right invocations for measuring timespans, and not rely on a naive &quot;let&#39;s get the time now and subtract it from the time later to get the difference&quot;, because they might end up with a timespan over &quot;slow&quot; or &quot;fast&quot; seconds.</div><div class="gmail_extra"><br></div><div class="gmail_extra">cheers,</div><div class="gmail_extra">Tim</div><div class="gmail_extra"><br></div><div class="gmail_quote">On 16 February 2016 at 00:49, Eliot Miranda <span dir="ltr">&lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Levente, Hi Bert, Hi All,<div class="gmail_extra"><br><div class="gmail_quote"><span>On Mon, Feb 15, 2016 at 3:39 PM, Levente Uzonyi <span dir="ltr">&lt;<a href="mailto:leves@caesar.elte.hu" target="_blank">leves@caesar.elte.hu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span>On Mon, 15 Feb 2016, Bert Freudenberg wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
On 15.02.2016, at 10:17, marcel.taeumel &lt;<a href="mailto:Marcel.Taeumel@hpi.de" target="_blank">Marcel.Taeumel@hpi.de</a>&gt; wrote:<br>
<br>
Hi Bert,<br>
<br>
this was just a regression. There has always been this check in the past for<br>
Morphic projects and still today for MVC projects.<br>
</blockquote>
<br>
Ah, so we lost the check at some point?<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
If you would have used VM or OS startup time, this would still be<br>
problematic after an overflow. (Hence the comment about snapshotting). So,<br>
this fix does not directly address the discussion about synching<br>
#millisecondClockValue to wall clock.<br>
</blockquote>
<br>
I still think it should answer milliseconds since startup. Why would we change that?<br>
</blockquote>
<br></span>
Eliot changed it recently. Probably to avoid the rollover issues. The correct fix would be to use to UTC clock instead of the local one in Time class &gt;&gt; #millisecondClockValue.<br></blockquote><div><br></div></span><div>I changed it for simplicity.  Alas it turns out to be a much more complex issue.  Here&#39;s a discussion I&#39;m having with Ryan Macnak, which covers what his team did with the Dart VM.  Please read, it&#39;s interesting.</div></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_extra"><div class="gmail_quote"><div><br></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div> <span style="color:rgb(80,0,80);font-size:12.8px">On Sun, Feb 14, 2016 at 12:08 AM,</span><span style="color:rgb(80,0,80);font-size:12.8px"> </span><span style="font-size:12.8px">Ryan</span><span style="color:rgb(80,0,80);font-size:12.8px"> </span><span style="color:rgb(80,0,80);font-size:12.8px">Macnak</span><span style="color:rgb(80,0,80);font-size:12.8px"> </span><span style="color:rgb(80,0,80);font-size:12.8px" dir="ltr">&lt;<a href="mailto:rmacnak@gmail.com" target="_blank">rmacnak@gmail.com</a>&gt;</span><span style="color:rgb(80,0,80);font-size:12.8px"> </span><span style="color:rgb(80,0,80);font-size:12.8px">wrote:</span></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote" style="color:rgb(0,0,0);font-size:12.8px"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, Feb 13, 2016 at 5:32 PM, Eliot Miranda <span dir="ltr">&lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt;</span> wrote:</div></div></div></blockquote></span></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote" style="color:rgb(0,0,0);font-size:12.8px"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi <span>Ryan</span>,</div></blockquote></div></div></div></blockquote></span></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote" style="color:rgb(0,0,0);font-size:12.8px"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><br></div></div></blockquote></div></div></div></blockquote></span></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote" style="color:rgb(0,0,0);font-size:12.8px"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, Feb 13, 2016 at 11:21 AM, <span>Ryan</span> Macnak <span dir="ltr">&lt;<a href="mailto:rmacnak@gmail.com" target="_blank">rmacnak@gmail.com</a>&gt;</span> wrote:</div></div></div></blockquote></div></div></div></blockquote></span></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote" style="color:rgb(0,0,0);font-size:12.8px"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">On Thu, Feb 11, 2016 at 10:46 PM, Eliot Miranda <span dir="ltr">&lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt;</span> wrote:</div></blockquote></div></div></div></blockquote></div></div></div></blockquote></span></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote" style="color:rgb(0,0,0);font-size:12.8px"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>    Further back <span>Ryan</span> wrote: </div></div></div></div></blockquote></div></div></div></blockquote></span></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote" style="color:rgb(0,0,0);font-size:12.8px"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>5) Travis found an assertion failure. Unfortunately the assertions fail to include paths with the line numbers.</div></div></blockquote></div></div></div></blockquote></div></div></div></blockquote></div></div></div></blockquote></div></div></div></blockquote></span></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote" style="color:rgb(0,0,0);font-size:12.8px"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><br></div></div></blockquote></div></div></div></blockquote></div></div></div></blockquote></div></div></div></blockquote></div></div></div></blockquote></span></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote" style="color:rgb(0,0,0);font-size:12.8px"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>(newUtcMicrosecondClock &gt;= utcMicrosecondClock 124)</div></div></blockquote></div></div></div></blockquote></div></div></div></blockquote></div></div></div></blockquote></div></div></div></blockquote></span></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote" style="color:rgb(0,0,0);font-size:12.8px"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div></div></div></div></blockquote></div></div></div></blockquote></div></div></div></blockquote></div></div></div></blockquote></span></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote" style="color:rgb(0,0,0);font-size:12.8px"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>It&#39;s easy to track down.  Just grep for the string.  You&#39;ll find it in sqUnixHeartbeat.c.  I&#39;ve seen this from time to time, and have yet to understand it. What OS are you seeing this on?</div></div></div></div></blockquote></div></div></div></blockquote></div></div></div></blockquote></div></div></div></blockquote></span></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote" style="color:rgb(0,0,0);font-size:12.8px"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div></div></div></div></blockquote></div></div></div></blockquote></div></div></div></blockquote></span></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote" style="color:rgb(0,0,0);font-size:12.8px"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Linux. Looking at the comment above this assert, I see Cog is using the wrong clock. One should not rely on the realtime clock (gettimeofday) to move steadily forward. It can jump around due to NTP syncs, the machine sleeping or the user changing the time settings. Programs running at startup on the Raspberry Pi in particular can see very large jumps because it has no hardware clock (battery too expensive) so the first NTP sync will be a very large correction. We fixed this in the Dart VM a few months ago. Timers need to be scheduled using the monotonic clock (Linux clock_gettime, Mac mach_absolute_time).</div></div></div></div></blockquote></div></div></div></blockquote></div></div></div></blockquote></span></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote" style="color:rgb(0,0,0);font-size:12.8px"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><br></div></div></blockquote></div></div></div></blockquote></span></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote" style="color:rgb(0,0,0);font-size:12.8px"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">Yes, this isn&#39;t satisfactory either.  One needs the VM to answer something that is close to wall time, not drift over time.  I think there needs to be some clever averaging algorithm that has the property of always advancing the clock but trying to converge on wall time.</div></div></blockquote></div></div></div></blockquote></span></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote" style="color:rgb(0,0,0);font-size:12.8px"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><br></div></div></blockquote></div></div></div></blockquote></span></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote" style="color:rgb(0,0,0);font-size:12.8px"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">One can imagine on every occasion that the VM updates its notion of the time it accesses both clock_gettime and gettimeofday and computes an offset that is some fraction of the delta between the current clock_gettime and the previous clock_gettime multiplied by the difference between the two clocks.  So the VM time is always monotonic, but hunts towards wall time as answered by gettimeofday.  </div></div></blockquote></div></div></div></blockquote></span></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote" style="color:rgb(0,0,0);font-size:12.8px"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><br></div></div></blockquote></div></div></div></blockquote></span></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote" style="color:rgb(0,0,0);font-size:12.8px"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">Thanks. I was unaware of clock_gettime &amp; mach_absolute_time.  Given these two it shouldn;t be too hard to concoct something that works.  Or is that the approach you&#39;ve taken in Dart?  Or are there standard algorithms out there?  I&#39;ll take a look.</div></div></blockquote></div></div></div></blockquote></span></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote" style="color:rgb(0,0,0);font-size:12.8px"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div></div></div></div></blockquote></span></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote" style="color:rgb(0,0,0);font-size:12.8px"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>I&#39;m not seeing why it needs to be close to wall time. The VM needs make both a wall clock and a monotonic clock available to the image.</div></div></div></div></blockquote></span></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote" style="color:rgb(0,0,0);font-size:12.8px"><span><div><br></div></span></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote" style="color:rgb(0,0,0);font-size:12.8px"><div>That&#39;s one way, but it&#39;s complex.  I think having a clock that is flexible, that will deviate by no more than a specified percentage from clock_gettime in approaching wall time is simpler for the user albeit more complex for the VM implementor.  It therefore seems to me to be in the Smalltalk tradition.</div></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote" style="color:rgb(0,0,0);font-size:12.8px"><span><div><br></div></span></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote" style="color:rgb(0,0,0);font-size:12.8px"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>In Dart, there are three uses of time</div></div></div></div></blockquote></span></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote" style="color:rgb(0,0,0);font-size:12.8px"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Stopwatch measures durations (BlockClosure timeToRun). It uses the monotonic clock.</div></div></div></div></blockquote></span></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote" style="color:rgb(0,0,0);font-size:12.8px"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Timer schedules a future notification (Delay wait). It uses the monotonic clock.</div></div></div></div></blockquote></span></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote" style="color:rgb(0,0,0);font-size:12.8px"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>DateTime gets a timestamp (DateAndTime now). It uses the wall clock.</div></div></div></div></blockquote></span></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote" style="color:rgb(0,0,0);font-size:12.8px"><span><div><br></div></span></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote" style="color:rgb(0,0,0);font-size:12.8px"><div>Makes sense, at the cost of having two clocks.</div></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote" style="color:rgb(0,0,0);font-size:12.8px"><span><div> </div></span></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote" style="color:rgb(0,0,0);font-size:12.8px"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">Smalltalk has the additional complication of handling in-flight Delays or timeToRuns as an image moves across processes. There will be a discontinuity in both clocks, and both of them can move backwards. The logic to deal with the discontinuity must already exist for Delays, though I suspect no one has bothered for timeToRun. If I create a thousand Delays spaced apart by a minute, snapshot, move the system time forward a day, then resume, they remain evenly spaced. If I do this while the image is still running, they all fire at once and the VM becomes unresponsive, which is what using the monotonic clock would fix.</div></div></div></blockquote></span></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote" style="color:rgb(0,0,0);font-size:12.8px"><span><div><br></div></span></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote" style="color:rgb(0,0,0);font-size:12.8px"><div>Yes, but there is another way.  Delays can be implemented to function as durations, not deadlines.  This is orthogonal to clocks.  If Delays are deadlines then it is correct that on start-up they all fire.  If they are durations, it is not.</div></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_quote" style="color:rgb(0,0,0);font-size:12.8px"><div><br></div></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div style="color:rgb(0,0,0);font-size:12.8px"><div><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_</div></span></div></div></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div style="color:rgb(0,0,0);font-size:12.8px"><div><div><span style="font-size:small;border-collapse:separate"><div>best, Eliot</div></span></div></div></div></div></div></blockquote><div class="gmail_extra"><div class="gmail_quote"><span><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Currently this change also affects performance (down to 8-10% of the previous implementation), because of the creation of multiple LargeIntegers.<br></blockquote><div><br></div></span><div>This is no longer an issue in 64-bits ;-).  But even if answering large integers is slower it doesn&#39;t impact real applications since they spend little of their time in the delay &amp; timing part of the code.  But I&#39;m sure that Nicolas &amp; I can do something about large integer performance.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Levente<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
- Bert -<br>
<br>
<br>
<br>
<br>
</blockquote>
<br><span class="HOEnZb"><font color="#888888">
</font></span></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</font></span></div></div>
<br><br>
<br></blockquote></div><div class="gmail_extra"><br></div></div>