<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Apr 8, 2013 at 7:40 AM, Aliaksey Kandratsenka <span dir="ltr"><<a href="mailto:alkondratenko@gmail.com" target="_blank">alkondratenko@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote"><div class="im">On Mon, Apr 8, 2013 at 7:04 AM, Björn Gustavsson <span dir="ltr"><<a href="mailto:bgustavsson@gmail.com" target="_blank">bgustavsson@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks for the bug report and patch!<div><br></div><div>The patch, however, is not acceptable since</div>
<div>it replaces a call to erlang:now/0 with a call to</div><div>os:timestamp/0. os:timestamp/0 does no</div>
<div>time correction while erlang:now/0 does, so there</div><div>will be trouble if time correction is being done.</div><div><br></div><div>Did you have any particular reason to use</div><div>
os:timestamp/0? It seems to me that using</div><div>erlang:now/0 should work just as well.</div></div></blockquote><div><br></div></div><div>It would work reasonably well.</div><div><br></div><div>But here's my thinking.</div>
<div><br></div><div>If wall clock time jumps backward then os:timestamp will also jump backwards and we're screwed. I.e. no ticks will happen until time will naturally advance to a time before jump. erlang:now will not jump backwards, but it will not do any "time correction" either. It'll just "crawl forward" by 1 microsecond per erlang:now call which is in my definition screwed either.</div>
</div></div></div></blockquote><div><br></div><div style>Actually I forgot but my thinking was a bit more elaborate.</div><div style><br></div><div style>If we use erlang:now and time jumps backwards. We'll have time as seen by receive X -> X after AfterMillis -> ok end flow normally, but erlang:now will crawl. Which can be seen to cause same busy wait in timer server but just for much longer (i.e. until erlang:now overtakes os:timestamp where that "never go back" code path stops being hit and time flows normal again).</div>
<div style><br></div><div style>I should have noted that in git comment but forgot.</div><div style><br></div><div style>Let me know if you need anything more from me. Like adjusted git comment.</div></div></div></div>