[Twisted-Python] Re: Twisted-Python Digest, Vol 21, Issue 39

Michael Schneider michaelschneider at fuse.net
Sat Dec 31 14:23:55 EST 2005


On Windows, you might use time.clock() it is more precise (keep with 
time.time on UNIX

Hope this helps,
Mike

>
>
>Message: 2
>Date: Sat, 31 Dec 2005 12:42:07 -0500
>From: James Y Knight <foom at fuhm.net>
>Subject: Re: [Twisted-Python] Re: [Twisted-commits] r15451 - Fix test
>	failures	under windows by changing the eventual-send operation to
>To: Twisted general discussion <twisted-python at twistedmatrix.com>
>Message-ID: <5F60A50B-53F9-4AC2-AECA-681882929FB3 at fuhm.net>
>Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
>
>
>On Dec 31, 2005, at 11:59 AM, James Y Knight wrote:
>
>  
>
>>On Dec 31, 2005, at 1:39 AM, Brian Warner wrote:
>>
>>    
>>
>>>callLater(0) does not guarantee
>>>relative ordering of sequentially-scheduled calls,
>>>
>>>      
>>>
>>Yes it does: order of method call.
>>
>>
>>    
>>
>>>and the windows
>>>reactors in fact execute them in random order.
>>>
>>>      
>>>
>>That is broken.
>>    
>>
>
>I'm afraid this is my fault. Heapq does not guarantee stable ordering  
>amongst elements with the same key, and on windows, two successive  
>calls to time.time() are very likely to return the same number,  
>because of its poor resolution. The same error could probably occur  
>on unix/linux systems as well, although currently unlikely to the  
>point of impossibility. It should be fixable by storing the last time  
>of an element added to the queue, and adding epsilon if current time  
>is the same.
>
>Just as a point of interest, on my system, this loop never finishes:
>import time
>def f():
>  while 1:
>   if time.time()==time.time():
>    break
>
>But this one does:
>from time import time
>def f():
>  while 1:
>   if time()==time():
>    break
>
>
>James
>
>
>
>------------------------------
>
>_______________________________________________
>Twisted-Python mailing list
>Twisted-Python at twistedmatrix.com
>http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
>
>End of Twisted-Python Digest, Vol 21, Issue 39
>**********************************************
>
>  
>


-- 
The greatest performance improvement occurs on the transition of from the non-working state to the working state.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20051231/e774a614/attachment.htm 


More information about the Twisted-Python mailing list