[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

On 16/02/12 06:43, Guido van Rossum wrote:
> This does not explain why microseconds aren't good enough. It seems
> none of the clocks involved can actually measure even relative time
> intervals more accurate than 100ns, and I expect that kernels don't
> actually keep their clock more accurate than milliseconds.

I gather that modern x86 CPUs have a counter that keeps track of
time down to a nanosecond or so by counting clock cycles. In
principle it seems like a kernel should be able to make use of
it in conjunction with other timekeeping hardware to produce
nanosecond-resolution timestamps.

Whether any existing kernel actually does that is another
matter. It probably isn't worth the bother for things like
file timestamps, where the time taken to execute the system
call that modifies the file is likely to be several orders
of magnitude larger.

Until we have computers with terahertz clocks and gigahertz
disk drives, it seems like a rather theoretical issue. And it
doesn't look like Mr. Moore is going to give us anything like
that any time soon.