[Python-Dev] time.clock() on windows

Nick Coghlan ncoghlan at gmail.com
Thu Oct 22 22:49:19 CEST 2009

Kristján Valur Jónsson wrote:
> Yes.  The problem with QPC is that although it has very high
> resolution, it is not precise in the long term.  And
> GetSystemTimeAsFileTime() is high precision in the long term but only
> updated evey 20ms or so. In EVE Online we use a combination of the
> two for high resolution, long term precision.  But I'm not happy with
> the way I'm doing it.  It needs some sort of smoothing of course.
> I've even played with using Kalman filtering to do it... The idea is
> to use the low frequency timer to apply correction coefficients to
> the high frequency timer, yet keep the flow of time smooth (no
> backwards jumps because of corrections.).  An optimal solution has so
> far eluded me.

That sounds very similar to the problem spec for system time corrections
in Network Time Protocol client implementations. Perhaps the time
drifting algorithms in the NTP specs are relevant? Or are they too slow
to correct discrepancies?


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Python-Dev mailing list