How to measure elapsed time under Windows?

Tim Roberts timr at
Sat Feb 13 21:29:45 CET 2010

"Gabriel Genellina" <gagsl-py2 at> wrote:
>The original problem was with the RDTSC instruction on multicore CPUs;  
>different cores may yield different results because they're not  
>synchronized at all times.

Not true.  The synchronization issue has two causes:  initial
synchronization at boot time, and power management making microscopic
adjustments to the clock rate.  In Windows NT 4, Microsoft took extra pains
to adjust the cycle counters on multiprocessor computers during boot so
that the processors started out very close together.  Once set, they
naturally remained in lock step, until aggressive power management because
more prevalent.  In XP, they stopped trying to align at boot time.

>Windows XP was launched in 2001, and the first dual core processors able  
>to execute Windows were AMD Opteron and IBM Pentium D, both launched  
>around April 2005 (and targeting the server market, not the home/desktop  
>market of Windows XP).
>How could MS know in 2001 of a hardware issue that would happen four years  
>in the future?

No, you're underestimating the problem.  The issue occurs just as much in
machines with multiple processor chips, which was supported clear back in
the original NT 3.1, 1992.
Tim Roberts, timr at
Providenza & Boekelheide, Inc.

More information about the Python-list mailing list