using timeit for a function in a class

Fredrik Lundh fredrik at pythonware.com
Fri May 27 02:04:19 EDT 2005


"flupke" wrote:

> ? i think you missed some of the code
> ...
>      s = """
>      test = TimeTest()
>      test.f()
>      """
> ...
>
> So the function is being called (as i said, it prints the hello message).

timeit is a benchmark utility.  it's supposed to call your function
enough times to get an accurate result.

if you want to time a single call, using timeit instead of time is
just plain silly.

</F>






More information about the Python-list mailing list