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

On Windows, you might use time.clock() it is more precise (keep with time.time on UNIX Hope this helps, Mike
-- The greatest performance improvement occurs on the transition of from the non-working state to the working state.

On Sat, 31 Dec 2005 14:23:55 -0500, Michael Schneider <michaelschneider@fuse.net> wrote:
On Windows, you might use time.clock() it is more precise (keep with time.time on UNIX
Unfortunately, it wraps around after ~40 days, making it unsuitable for use tracking long periods of time. It is probably possible to build a usable timer on top of this using a wrap-around counter, but afaik no one has yet attempted this. Jean-Paul

----- Original Message ----- From: "Jean-Paul Calderone" <exarkun@divmod.com> To: "Twisted general discussion" <twisted-python@twistedmatrix.com> Sent: Saturday, December 31, 2005 2:52 PM Subject: Re: [Twisted-Python] Re: Twisted-Python Digest, Vol 21, Issue 39
it's actually slightly less than 50 days. time.clock() is not usable on windows, i think, without being able to determine its frequency (you need to be able to do QueryPerformanceFrequency() iirc). there's a right way to do this (although the api may not be available from python/pywin32), i just can't remember (i'm not very clueful when it comes to windows and whatever experience i had was a long time ago). i'll sleep on it and see if i can remember it in the morning. -p

On Sat, 31 Dec 2005 14:23:55 -0500, Michael Schneider <michaelschneider@fuse.net> wrote:
On Windows, you might use time.clock() it is more precise (keep with time.time on UNIX
Unfortunately, it wraps around after ~40 days, making it unsuitable for use tracking long periods of time. It is probably possible to build a usable timer on top of this using a wrap-around counter, but afaik no one has yet attempted this. Jean-Paul

----- Original Message ----- From: "Jean-Paul Calderone" <exarkun@divmod.com> To: "Twisted general discussion" <twisted-python@twistedmatrix.com> Sent: Saturday, December 31, 2005 2:52 PM Subject: Re: [Twisted-Python] Re: Twisted-Python Digest, Vol 21, Issue 39
it's actually slightly less than 50 days. time.clock() is not usable on windows, i think, without being able to determine its frequency (you need to be able to do QueryPerformanceFrequency() iirc). there's a right way to do this (although the api may not be available from python/pywin32), i just can't remember (i'm not very clueful when it comes to windows and whatever experience i had was a long time ago). i'll sleep on it and see if i can remember it in the morning. -p
participants (3)
-
Jean-Paul Calderone
-
Michael Schneider
-
Paul G