<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 1, 2015 at 2:20 PM, Sergej Jurečko <span dir="ltr"><<a href="mailto:sergej.jurecko@gmail.com" target="_blank">sergej.jurecko@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Using 18.0.3 on OS X 10.10.5. I even tried rebooting the machine to check if the time turns negative after a while, but it seems it is always negative.<br><br>erlang:monotonic_time().<br>-576460736152226213</div></blockquote></div><br></div><div class="gmail_extra">This is the normal behavior. In order to use the full 60 bit signed value, it is custom to start at a negative number when starting a new Erlang node:<br><br>1> os:type().<br>{unix,freebsd}<br>2> erlang:monotonic_time().<br>-576460743520961806<br><br>1> os:type().<br>{unix,sunos}<br>2> erlang:monotonic_time().<br>-576460744933281955<br><br></div><div class="gmail_extra">And so on. You can only use monotonic_time() for doing checks relative to itself, as in:<br><br></div><div class="gmail_extra">B = erlang:monotonic_time(),<br></div><div class="gmail_extra">do_work(),<br></div><div class="gmail_extra">E = erlang:monotonic_time(),<br></div><div class="gmail_extra">Elapsed = erlang:convert_time_unit(E - B, native, micro_seconds),<br>...<br><br></div><div class="gmail_extra">As Loic writes, check the document on time and time correction.<br><br></div><div class="gmail_extra"><br clear="all"><br>-- <br><div class="gmail_signature">J.</div>
</div></div>