From: Peter N. <pn...@ya...> - 2000-06-09 17:30:33
|
> Thinking some more about this, I've realized that > time.clock() isn't > going to be helpful equalizing timing across > machines, since it is > itself dependent on machine speed. clock() ticks > every time the CPU > cycles, which means faster CPUs will have faster > clock()s, which means > we're back where we started. Hmm.. how does it convert it into seconds then, or is it just a bogus approximation? I'm still interested in > seeing the > results from testing time() on the Mac though, in > case the "1-second > precision" isn't actually as bad as it sounds. > Well... ironically it seems to have rock-solid 1.0-second precision every time: (G3 @450mHz): avg smallest difference between two calls to time(): 1.0 seconds. avg smallest difference between two calls to clock(): 0.0166666666667 seconds. (PPC 601 @110mHz:) avg smallest difference between two calls to time(): 1.0 seconds. avg smallest difference between two calls to clock(): 0.0166666666667 seconds. So it looks like the Mac version of Python has a different idea of what the time() and clock() functions should do: time() measures seconds, and clock() measures 'ticks' (i.e. 1/60 second like in Director). I suppose it's hard to know the exact accuracy there but they did seem to take the same amount of time to run. Maybe this is actually good news for the Mac in terms of keeping consistent frame rates or whatever, but it's too bad that there's apparently no consistency between platforms. Would this be something to bring up with python.org? > I've taken a look at the Vaults and throught Deja, > and haven't found a > more precise timer module for the Mac. In the worst > case scenario, > Mark would have to implement the timer subsystem in > order to get > reasonable cross-platform timing support. > This of course would be great but people seem to say it would be a pain to do and it doesn't seem high up on his list. --P __________________________________________________ Do You Yahoo!? Yahoo! Photos -- now, 100 FREE prints! http://photos.yahoo.com |