ANN: a new utility for Python developers

Markus Schaber markus at schabi.de
Wed Aug 22 15:26:09 EDT 2001


Hi,

Erno Kuusela <erno-news at erno.iki.fi> schrub:

> In article <mailman.998398653.29844.python-list at python.org>, Skip
> Montanaro <skip at pobox.com> writes:
> 
> | The limitations of Unix's CPU time granularity and the single-task
> | nature of Windows doesn't mean the semantics of time.clock should be
> | broken to get
> | higher resolution.  Besides, what about NT?  Doesn't it distinguish
> | between tasks?
> 
> the windows time.clock() calls a win32 api function that reads the
> time stamp counter register that x86 cpus have, and then divides it by
> the number of time stamp counter ticks per second. the time stamp
> counter does not stop at any point. i would guess that it works the
> same on the dos-based windows versions and on the nt-based ones.

Yes, that's right. And one problem with this TSC Register is when your 
CPU changes the clock frequency, as it is common on laptops.

The TSC really counts the CPU cycles since the last reboot of the 
machine, nothing more and nothing less.

markus
-- 
1) Customers cause problems.
2) Marketing is trying to create more customers.
Therefore:
3) Marketing is evil.  (Grand Edwards in comp.lang.python)



More information about the Python-list mailing list