[Haskell-cafe] Re: Computer time, independent of date

Steve Schafer steve at fenestra.com
Fri Jan 9 10:17:40 EST 2009

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
of reboots and other upsets. Perhaps the simplest and least expensive of
these is a computer-compatible GPS time receiver. Since GPS works on GPS
time (which has a constant offset from International Atomic Time),
rather than UTC, you avoid having to deal with leap seconds and the

I haven't tried doing it myself, but I know that most recent-vintage GPS
units have a computer interface over which you can download the current
GPS time from the device. There are many other kinds of GPS time
receivers available, including ones that plug directly into a PC slot.
Here's one that I found using a Google search on "GPS time receiver":


The prices range anywhere from a couple of hundred dollars for
consumer-grade equipment to many thousands for high-reliability devices.

The only drawback to this approach that I can think of is if the
hospital is in an urban area with lots of tall buildings, it might be
difficult to obtain a GPS signal of high enough quality. Some of the
purpose-built GPS time receivers have better antennas than a
consumer-grade GPS device.

Steve Schafer
Fenestra Technologies Corp

More information about the Haskell-Cafe mailing list