On May 24, 12:41 pm, 7stud <[EMAIL PROTECTED]> wrote:
> Actually, you can do this:
>
> class Dog(object):
>     def aFunction(self):
>         result = 20 + 2
>     def run(self):
>         #do stuff
>         aFunction()
>         #do other stuff
> import timeit
>
> t = timeit.Timer("d.aFunction()", "from __main__ import Dog; d =
> Dog()")
> print t.timeit()
>
> Since you only want to time aFunction(), you can call it directly.

Thanks for all the idea.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to