I'm running Mac OS X 10.8 and get strange behavior for time.clock(), which some online sources say I should prefer over time.time() for timing my code. For example:
import time
t0clock = time.clock()
t0time = time.time()
time.sleep(5)
t1clock = time.clock()
t1time = time.time()
print t1clock - t0clock
print t1time - t0time
0.00330099999999 <-- from time.clock(), clearly incorrect
5.00392889977 <-- from time.time(), correct
Why is this happening? Should I just use time.time() for reliable estimates?