On 2006-06-28, Pete Forman <[EMAIL PROTECTED]> wrote:
> "Fredrik Lundh" <[EMAIL PROTECTED]> writes:
> > simplest way:
> >
> > t0 = time.time()
>
> You can get better resolution by using time.clock() instead of
> time.time().
Oh really? When I do it, time.clock() is worse:
------------------------------timeit.py------------------------------
import time
for i in range(5):
t0 = time.time()
print "hi there"
print time.time()-t0
for i in range(5):
t0 = time.clock()
print "hi there"
print time.clock()-t0
------------------------------timeit.py------------------------------
hi there
0.000149011611938
hi there
4.10079956055e-05
hi there
3.981590271e-05
hi there
3.981590271e-05
hi there
3.88622283936e-05
hi there
0.0
hi there
0.0
hi there
0.0
hi there
0.0
hi there
0.0
--
Grant Edwards grante Yow! I'm a nuclear
at submarine under the
visi.com polar ice cap and I need
a Kleenex!
--
http://mail.python.org/mailman/listinfo/python-list