for loops longer on a P-IV???
peter at engcorp.com
Thu Aug 1 06:15:05 CEST 2002
> This is our wait function:
> def wait(Seconds):
> loop = Seconds * 50
> for i in range (0,loop):
> if win32ui.PumpWaitingMessages(0,-1):
> raise exceptions.SystemExit
> A 10 second wait on our P-IV seems to take 15 seconds [....]
I'm not certain what you are actually expecting, but the code you
have here is effectively the following for a "10 second" delay:
do this 500 times:
wait at least 20 milliseconds
do some other stuff that takes an undefined amount of time
It looks like you think this should take 500*20 milliseconds
to complete, but there are at least two sources of additional
delay -- the "at least" part, and the "other stuff" part.
You are actually accumulating error and the finer the period of
the sleep, the more inaccurate the overall time will be.
If you're looking for accuracy in timing, this is not the way
to go about it.
More information about the Python-list