using timeit for a function in a class

flupke flupke at nonexistingdomain.com
Thu May 26 19:00:19 EDT 2005


Kent Johnson wrote:
> flupke wrote:
> 
>>
>> Hi,
>>
>> i tried to use timeit on a function in a class but it doesn't do what 
>> i think it should do ie. time :)
>> In stead it starts printing line after line of hello time test!
>> What am i doing wrong in order to time the f function?
> 
> 
> Hmm, by default Timer.timeit() calls the function being timed 1000000 
> times. That's a lot of "hello time test" =:-)
> 
> Kent

Hehe, thanks Kent.
Need to drink more coffee and train the eyes more, a new goal in life :)

print t.timeit(1) did the trick.

Regards,
Benedict



More information about the Python-list mailing list