Brian Curtin <cur...@acm.org> added the comment:

> In Windows, it should probably use GetTickCount64 if available,
> otherwise GetTickCount with logic to handle wrapping.  I think
> QueryPerformanceCounter is problematic as a general-purpose timer:
> depending on the hardware and Windows version, it can be offset
> differently across CPUs, and may not be reliable on some processors.  It
> may be fixed in Vista or Win7, I'm not sure; if so it's much higher
> resolution than GTC.

I don't have a ton of experience with this, but by creating a synchronization 
point based on when the system clock changes, QueryPerformanceCounter can be 
pretty accurate and as you already stated, and higher resolution than most 
other solutions. http://msdn.microsoft.com/en-us/magazine/cc163996.aspx is 
where I got the idea and most of the implementation from. I'm essentially using 
the code from Figure 2 in a C extension right now to do something similar to 
threading.Timer in a performance testing tool.

----------
nosy: +brian.curtin

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10278>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to