G
Grant Edwards
What's the correct way to measure small periods of elapsed
time. I've always used time.clock() in the past:
start = time.clock()
[stuff being timed]
stop = time.clock()
delta = stop-start
However on multi-processor machines that doesn't work.
Sometimes I get negative values for delta. According to
google, this is due to a bug in Windows that causes the value
of time.clock() to be different depending on which core in a
multi-core CPU you happen to be on. [insert appropriate
MS-bashing here]
Is there another way to measure small periods of elapsed time
(say in the 1-10ms range)?
Is there a way to lock the python process to a single core so
that time.clock() works right?
time. I've always used time.clock() in the past:
start = time.clock()
[stuff being timed]
stop = time.clock()
delta = stop-start
However on multi-processor machines that doesn't work.
Sometimes I get negative values for delta. According to
google, this is due to a bug in Windows that causes the value
of time.clock() to be different depending on which core in a
multi-core CPU you happen to be on. [insert appropriate
MS-bashing here]
Is there another way to measure small periods of elapsed time
(say in the 1-10ms range)?
Is there a way to lock the python process to a single core so
that time.clock() works right?