<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
On Windows, you might use time.clock() it is more precise (keep with
time.time on UNIX<br>
<br>
Hope this helps,<br>
Mike<br>
<br>
<blockquote cite="midE1Esl1P-0002bb-01@pyramid.twistedmatrix.com"
 type="cite"><br>
  <pre wrap="">

Message: 2
Date: Sat, 31 Dec 2005 12:42:07 -0500
From: James Y Knight <a class="moz-txt-link-rfc2396E" href="mailto:foom@fuhm.net">&lt;foom@fuhm.net&gt;</a>
Subject: Re: [Twisted-Python] Re: [Twisted-commits] r15451 - Fix test
        failures        under windows by changing the eventual-send operation to
To: Twisted general discussion <a class="moz-txt-link-rfc2396E" href="mailto:twisted-python@twistedmatrix.com">&lt;twisted-python@twistedmatrix.com&gt;</a>
Message-ID: <a class="moz-txt-link-rfc2396E" href="mailto:5F60A50B-53F9-4AC2-AECA-681882929FB3@fuhm.net">&lt;5F60A50B-53F9-4AC2-AECA-681882929FB3@fuhm.net&gt;</a>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed


On Dec 31, 2005, at 11:59 AM, James Y Knight wrote:

  </pre>
  <blockquote type="cite">
    <pre wrap="">On Dec 31, 2005, at 1:39 AM, Brian Warner wrote:

    </pre>
    <blockquote type="cite">
      <pre wrap="">callLater(0) does not guarantee
relative ordering of sequentially-scheduled calls,

      </pre>
    </blockquote>
    <pre wrap="">Yes it does: order of method call.


    </pre>
    <blockquote type="cite">
      <pre wrap="">and the windows
reactors in fact execute them in random order.

      </pre>
    </blockquote>
    <pre wrap="">That is broken.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
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
<a class="moz-txt-link-abbreviated" href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a>
<a class="moz-txt-link-freetext" href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a>


End of Twisted-Python Digest, Vol 21, Issue 39
**********************************************

  </pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">-- 
The greatest performance improvement occurs on the transition of from the non-working state to the working state.
</pre>
</body>
</html>