[Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

Guido van Rossum guido at python.org
Wed Feb 15 17:39:45 CET 2012


I just came to this thread. Having read the good arguments on both
sides, I keep wondering why anybody would care about nanosecond
precision in timestamps. Unless you're in charge of managing one of
the few atomic reference clocks in the world, your clock is not going
to tell time that accurate. (Hey, we don't even admit the existence of
leap seconds in most places -- not that I mind. :-)

What purpose is there to recording timestamps in nanoseconds? For
clocks that start when the process starts running, float *is*
(basically) good enough. For measuring e.g. file access times, there
is no way that the actual time is know with anything like that
precision (even if it is *recorded* as a number of milliseconds --
that's a different issue).

Maybe it's okay to wait a few years on this, until either 128-bit
floats are more common or cDecimal becomes the default floating point
type? In the mean time for clock freaks we can have a few specialized
APIs that return times in nanoseconds as a (long) integer.

-- 
--Guido van Rossum (python.org/~guido)


More information about the Python-Dev mailing list