time.clock() going backwards??

Claudio Grondi claudio.grondi at freenet.de
Fri Aug 25 17:05:03 EDT 2006


Terry Reedy wrote:
> "Giovanni Bajo" <noway at sorry.com> wrote in message 
> news:vkFHg.82529$_J1.759243 at twister2.libero.it...
> 
>>Hello,
>>
>>I experimented something very strange, a few days ago. I was debugging an
>>application at a customer's site, and the problem turned out to be that
>>time.clock() was going "backwards", that is it was sometimes 
>>(randomically)
>>returning a floating point value which was "less than" the value returned 
>>by
>>the previous invokation. The computer was a pretty fast one (P4 3Ghz I 
>>think,
>>running Windows XP), and this happened only between very close 
>>invokations of
>>time.clock().
> 
> 
> I seem to remember this being mentioned before on the list, perhaps by Tim 
> Peters.  Perhaps he will chime in.
> 
> tjr
If I remember it right, the cause of such a problem is updating the 
clock by accessing a time server over a network. Just any such access 
results in adjusting the time a bit and leads eventually to such problems.

Claudio Grondi



More information about the Python-list mailing list