I\'m trying to find out how much time it takes to execute a Python statement, so I looked online and found that the standard library provides a module called timeit that pur
You can try this hack:
import timeit def foo(): print 'bar' def dotime(): t = timeit.Timer("foo()") time = t.timeit(1) print "took %fs\n" % (time,) import __builtin__ __builtin__.__dict__.update(locals()) dotime()