[Python-checkins] r46505 -python/trunk/Tools/pybench/systimes.py

Fredrik Lundh fredrik at pythonware.com
Fri Jun 2 14:12:32 CEST 2006


M.-A. Lemburg wrote:
>> FYI, I always see a non-zero, and increasing, value for KernelTime on
>> my box (WinXP Pro SP2).
>> Using your code I now see non-zero values as well - perhaps
> KernelTime refers to calls being made to the win32 APIs ?!

huh? what else would it refer to ? (what do you think "system time" refers
to on a Unix machine?)
>> One run of that here:
>>>> saw 74 distinct values in 134542 tries across 1.00000616787 seconds
>> user 11562500 kernel 2187500
>>>> saw 81 distinct values in 133365 tries across 1.00000220027 seconds
>> user 24062500 kernel 2968750
>>>> saw 68 distinct values in 132984 tries across 1.0000078902 seconds
>> user 34531250 kernel 4687500
>> Question is whether this is really bad resolution or just the
> effect of the OS not fetching the timer value in real-time,
> but using some variable that is only updated at 50-100 Hz.

but, but, but... didn't I just point out that process time is based on *sampling* of
the program counter by the system's scheduler, not on measurements using some
high-performance timer. the standard tick interval on a Windows machine is 10-15
ms, depending on platform. (to check the tick on your machine, you can write a
simple "time.time() - time.time() until you get back a non-zero value" will reveal,
or use http://www.sysinternals.com/Utilities/ClockRes.html ). there is no process
timer.
this is getting too weird for me. I need some coffee and a break.
</F> 


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /