From: Peter N. <pn...@ya...> - 2000-06-09 17:53:59
|
Here's a post I found in the mail archives -- the last part by Guido Van Rossum is relevant to this: > Test Case: > import time > for i in range(100000): time.sleep(1) ; print time.clock() > > Expected Behaviour: > clock() should increment by 1 after each call to sleep() > > Actual Behaviour: > clock() does not seem to increment at all! This is either a bug, or a documentation error. The library manual does > not seem to say or imply that time.sleep() should interfere with time.clock(). It's not a bug. On Unix, clock() counts "CPU time", and a sleep doesn't increment the CPU time (the CPU is given to another process). On Windows, clock() *does* count real time -- there's no sufficiently accurate CPU time available on that platform. The documentation (http://www.python.org/doc/current/lib/module-time.html) does mention CPU-time -- so I'm not sure what you want changed? --Guido van Rossum (home page: http://www.python.org/~guido/) __________________________________________________ Do You Yahoo!? Yahoo! Photos -- now, 100 FREE prints! http://photos.yahoo.com |