Namespaces and the timeit module

Roy Smith roy at panix.com
Tue Dec 14 04:34:03 CET 2004


cookedm+news at physics.mcmaster.ca (David M. Cooke) wrote:

> > It seems kind of surprising that I can't time functions.  Am I just not 
> > seeing something obvious?
> 
> Like the documentation for Timer? :-)
> 
> class Timer([stmt='pass' [, setup='pass'  [, timer=<timer function>]]])
> 
> You can't use statements defined elsewhere, you have to define them in
> the setup arguments (as a string).

Doh!  Of course.  Now that you point it out, it makes perfect sense, but 
I didn't get that from reading the description.  Thanks.



More information about the Python-list mailing list