Here&#39;s a basic draft project for clock_gettime(CLOCK_MONOTONIC, ...)<br>
<a href="http://sert.homedns.org/hs/mnsec/">http://sert.homedns.org/hs/mnsec/</a><br>
<a href="http://sert.homedns.org/hs/mnsec/dist/mnsec-1.0.0.tar.gz">http://sert.homedns.org/hs/mnsec/dist/mnsec-1.0.0.tar.gz</a><br>
<br>
It could be extended to cover other clock types than just monotonic.<br>
<br>
Regards,<br>
CS<br><br><div class="gmail_quote">2009/1/9 John Goerzen <span dir="ltr">&lt;<a href="mailto:jgoerzen@complete.org">jgoerzen@complete.org</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">Steve Schafer wrote:<br>
&gt; On Fri, 09 Jan 2009 11:01:18 -0200, you wrote:<br>
&gt;<br>
&gt;&gt; I&#39;m writing a program that will read medical signs<br>
&gt;&gt;from many patients. It&#39;s important to have a precise<br>
&gt;&gt; measure of the time interval between some signs, and<br>
&gt;&gt; that can&#39;t depend on adjustments of time. (Supose<br>
&gt;&gt; my software is running midnight at the end of a year<br>
&gt;&gt; with leap seconds. I would get wrong time intervals.)<br>
&gt;<br>
&gt; If you really need that level of accuracy, there is nothing available on<br>
&gt; an off-the-shelf machine that will do the job. You need an independent<br>
&gt; timekeeping source of some kind, one that is not subject to the vagaries<br>
<br>
</div>I&#39;m not sure that the original question implied *that* level of need.<br>
<br>
Linux has High-Resolution Timers (HRTs) that may be appropriate. &nbsp;See<br>
the manpage for clock_gettime(), which defines these HRTs:<br>
<br>
 &nbsp; &nbsp; &nbsp; CLOCK_REALTIME<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;System-wide real-time clock. &nbsp;Setting this clock requires<br>
appropriate privi-<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;leges.<br>
<br>
 &nbsp; &nbsp; &nbsp; CLOCK_MONOTONIC<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Clock &nbsp;that &nbsp;cannot be set and represents monotonic time<br>
since some unspeci-<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fied starting point.<br>
<br>
 &nbsp; &nbsp; &nbsp; CLOCK_PROCESS_CPUTIME_ID<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;High-resolution per-process timer from the CPU.<br>
<br>
 &nbsp; &nbsp; &nbsp; CLOCK_THREAD_CPUTIME_ID<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Thread-specific CPU-time clock.<br>
<br>
CLOCK_MONOTONIC, in particular, looks suitable. &nbsp;Using it could be a<br>
matter of just a few quick likes in FFI.<br>
<br>
I don&#39;t know if Windows has similar features.<br>
<font color="#888888"><br>
-- John<br>
</font><div><div></div><div class="Wj3C7c">_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br>