On Fri, 03 Nov 2006 18:02:37 -0800, Carl Banks wrote:
import timeit
timeit.Timer("foo(1)","from __main__ import foo")
> 1.1497418880462646
Well, that was scarily simple.
Thank you.
--
Steven.
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano wrote:
> The timeit module is ideal for measuring small code snippets; I want to
> measure large function objects.
>
> Because the timeit module takes the code snippet argument as a string, it
> is quite handy to use from the command line, but it is less convenient for
> timing lar
The timeit module is ideal for measuring small code snippets; I want to
measure large function objects.
Because the timeit module takes the code snippet argument as a string, it
is quite handy to use from the command line, but it is less convenient for
timing large pieces of code or when working i