<div dir="ltr"><div>Hello list,</div><div><br></div><div>I've recently run into an unexpected behaviour of erlcron[1] - it doesn't account for any time period the computer spends suspended - scheduled events get delayed by equal amounts.</div><div><br></div><div>This is because it leverages gen_server timeouts which, in turn, use bog-standard VM timeouts, which behave in the way I described. I've confirmed[2] their behaviour by comparing time elapsed until timeout according to erlang:monotonic_time/1 vs. os:system_time/1.</div><div><br></div><div>After delving into the Erlang/OTP source code for a while I realized there are two configuration options[3] that appear to control the unexpected behaviour: "<span>--enable-prefer-elapsed-monotonic-time-during-suspend" and "<span>--disable-prefer-elapsed-monotonic-time-during-suspend", introduced[4] in OTP 18.0.2.<br></span></span></div><div><span><span><br></span></span></div><div><span><span>The default value of the setting configured by either of those two options is "no"[5] - that is, elapsed monotonic time during suspend is not prefered.<br><br>I would like to know the rationale for this. Is it for:</span></span></div><div><span><span>- performance reasons? (say, because it's faster and server hardware rarely suspends, if at all)<br></span></span></div><div><span><span>- intended behaviour? (contrary to my expectations)</span></span></div><div><span><span><br></span></span></div><div><span><span>I'd be thankful for your thoughts on this matter and whether you think the default behaviour should be changed.<br></span></span></div><div><br></div><div>[1]: <a href="https://github.com/erlware/erlcron" target="_blank">https://github.com/erlware/erlcron</a></div><div>[2]: <a href="https://gist.github.com/g-andrade/508c779a931dde14c22c6e96319caa24" target="_blank">https://gist.github.com/g-andrade/508c779a931dde14c22c6e96319caa24</a><br>[3]: <a href="http://erlang.org/documentation/doc-10.5/doc/installation_guide/INSTALL.html#configuring" target="_blank">http://erlang.org/documentation/doc-10.5/doc/installation_guide/INSTALL.html#configuring</a></div><div>[4]: <a href="https://github.com/erlang/otp/commit/4a864c1cbe16a42f3f5190881187e3c9849e985f" target="_blank">https://github.com/erlang/otp/commit/4a864c1cbe16a42f3f5190881187e3c9849e985f</a></div><div>[5]: <a href="https://github.com/erlang/otp/blob/OTP-22.3.4/erts/aclocal.m4#L2355-L2358" target="_blank">https://github.com/erlang/otp/blob/OTP-22.3.4/erts/aclocal.m4#L2355-L2358<br></a></div><div><a href="https://github.com/erlang/otp/blob/OTP-22.3.4/erts/aclocal.m4#L2355-L2358" target="_blank"></a></div><div><div><br>-- <br><div dir="ltr" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Guilherme<br></div></div></div></div></div></div></div></div></div>