[Haskell-cafe] Re: Computer time, independent of date
cetin.sert at gmail.com
Fri Jan 9 10:53:01 EST 2009
Here's a basic draft project for clock_gettime(CLOCK_MONOTONIC, ...)
It could be extended to cover other clock types than just monotonic.
2009/1/9 John Goerzen <jgoerzen at complete.org>
> Steve Schafer wrote:
> > On Fri, 09 Jan 2009 11:01:18 -0200, you wrote:
> >> I'm writing a program that will read medical signs
> >>from many patients. It's important to have a precise
> >> measure of the time interval between some signs, and
> >> that can't depend on adjustments of time. (Supose
> >> my software is running midnight at the end of a year
> >> with leap seconds. I would get wrong time intervals.)
> > If you really need that level of accuracy, there is nothing available on
> > an off-the-shelf machine that will do the job. You need an independent
> > timekeeping source of some kind, one that is not subject to the vagaries
> I'm not sure that the original question implied *that* level of need.
> Linux has High-Resolution Timers (HRTs) that may be appropriate. See
> the manpage for clock_gettime(), which defines these HRTs:
> System-wide real-time clock. Setting this clock requires
> appropriate privi-
> Clock that cannot be set and represents monotonic time
> since some unspeci-
> fied starting point.
> High-resolution per-process timer from the CPU.
> Thread-specific CPU-time clock.
> CLOCK_MONOTONIC, in particular, looks suitable. Using it could be a
> matter of just a few quick likes in FFI.
> I don't know if Windows has similar features.
> -- John
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe