Re: using timeit for a function in a class

2005-05-26 Thread Fredrik Lundh
"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

Re: using timeit for a function in a class

2005-05-26 Thread flupke
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,

Re: using timeit for a function in a class

2005-05-26 Thread flupke
Fredrik Lundh wrote: > "flupke" wrote: > > >>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? > > > how do you expec

Re: using timeit for a function in a class

2005-05-26 Thread Kent Johnson
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

Re: using timeit for a function in a class

2005-05-26 Thread Fredrik Lundh
"flupke" wrote: > 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? how do you expect timeit to figure out how long it

using timeit for a function in a class

2005-05-26 Thread flupke
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? class TimeTest(object): def f(self): print "hello time