https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112014-08-15T09:59:02ZRuby Issue Tracking SystemRuby master - Feature #10138: Access monotonic counter in Timehttps://bugs.ruby-lang.org/issues/10138?journal_id=483522014-08-15T09:59:02Znormalperson (Eric Wong)normalperson@yhbt.net
<ul></ul><p><a href="mailto:cmouse@cmouse.fi" class="email">cmouse@cmouse.fi</a> wrote:</p>
<blockquote>
<p>time-s-monotonic.patch (2.07 KB)</p>
</blockquote>
<p>It might be better to put the OS compatibility code in the existing<br>
Process.clock_gettime implementation</p> Ruby master - Feature #10138: Access monotonic counter in Timehttps://bugs.ruby-lang.org/issues/10138?journal_id=483532014-08-15T10:00:38Zcmouse (Aki Tuomi)cmouse@cmouse.fi
<ul></ul><p>Eric Wong wrote:</p>
<blockquote>
<p><a href="mailto:cmouse@cmouse.fi" class="email">cmouse@cmouse.fi</a> wrote:</p>
<blockquote>
<p>time-s-monotonic.patch (2.07 KB)</p>
</blockquote>
<p>It might be better to put the OS compatibility code in the existing<br>
Process.clock_gettime implementation</p>
</blockquote>
<p>Not sure. It is not same as clock_gettime, which accepts parameters and such, and it is not clock_gettime across operating systems.</p>
<p>Also, the point of this patch is to enable access to uniform monotonic clock, so that you don't need to check for OS, what clock you want etc. Process.clock_gettime is simply method exposure, and I would think most people would not appreciate that on OS/X or Windows it does something completely different.</p> Ruby master - Feature #10138: Access monotonic counter in Timehttps://bugs.ruby-lang.org/issues/10138?journal_id=483552014-08-15T16:13:48Znaruse (Yui NARUSE)naruse@airemix.jp
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Rejected</i></li></ul><p>Aki Tuomi wrote:</p>
<blockquote>
<p>Eric Wong wrote:</p>
<blockquote>
<p><a href="mailto:cmouse@cmouse.fi" class="email">cmouse@cmouse.fi</a> wrote:</p>
<blockquote>
<p>time-s-monotonic.patch (2.07 KB)</p>
</blockquote>
<p>It might be better to put the OS compatibility code in the existing<br>
Process.clock_gettime implementation</p>
</blockquote>
<p>Not sure. It is not same as clock_gettime, which accepts parameters and such, and it is not clock_gettime across operating systems.</p>
<p>Also, the point of this patch is to enable access to uniform monotonic clock, so that you don't need to check for OS, what clock you want etc. Process.clock_gettime is simply method exposure, and I would think most people would not appreciate that on OS/X or Windows it does something completely different.</p>
</blockquote>
<p>Process.clock_gettime already have compatibility layer for OS X and Windows.<br>
Therefore Process.clock_gettime(Process::CLOCK_MONOTONIC) is portable</p> Ruby master - Feature #10138: Access monotonic counter in Timehttps://bugs.ruby-lang.org/issues/10138?journal_id=483582014-08-15T16:30:01Zcmouse (Aki Tuomi)cmouse@cmouse.fi
<ul></ul><p>Yui NARUSE wrote:</p>
<blockquote>
<p>Aki Tuomi wrote:</p>
<blockquote>
<p>Eric Wong wrote:</p>
<blockquote>
<p><a href="mailto:cmouse@cmouse.fi" class="email">cmouse@cmouse.fi</a> wrote:</p>
<blockquote>
<p>time-s-monotonic.patch (2.07 KB)</p>
</blockquote>
<p>It might be better to put the OS compatibility code in the existing<br>
Process.clock_gettime implementation</p>
</blockquote>
<p>Not sure. It is not same as clock_gettime, which accepts parameters and such, and it is not clock_gettime across operating systems.</p>
<p>Also, the point of this patch is to enable access to uniform monotonic clock, so that you don't need to check for OS, what clock you want etc. Process.clock_gettime is simply method exposure, and I would think most people would not appreciate that on OS/X or Windows it does something completely different.</p>
</blockquote>
<p>Process.clock_gettime already have compatibility layer for OS X and Windows.<br>
Therefore Process.clock_gettime(Process::CLOCK_MONOTONIC) is portable</p>
</blockquote>
<p>So it would indeed seem, although I could not see Win32 listed as supported for CLOCK_MONOTONIC, but this could be just my misunderstanding. Thank you for the fast reply anyways!</p>