Re: How can I time a method of a class in python using Timeit

2007-05-24 Thread 7stud
On May 24, 12:23 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > 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 > >

Re: How can I time a method of a class in python using Timeit

2007-05-24 Thread 7stud
On May 24, 12:23 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > 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 > >

Re: How can I time a method of a class in python using Timeit

2007-05-24 Thread [EMAIL PROTECTED]
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()

Re: How can I time a method of a class in python using Timeit

2007-05-24 Thread [EMAIL PROTECTED]
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()

Re: How can I time a method of a class in python using Timeit

2007-05-24 Thread 7stud
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

Re: How can I time a method of a class in python using Timeit

2007-05-24 Thread 7stud
On May 24, 11:30 am, 7stud <[EMAIL PROTECTED]> wrote: > On May 24, 9:36 am, "[EMAIL PROTECTED]" > > > > <[EMAIL PROTECTED]> wrote: > > Hi, > > > I am using timeit to time a global function like this > > > t = timeit.Timer("timeTest()","from __main__ import timeTest") > > result = t.timeit(); > > >

Re: How can I time a method of a class in python using Timeit

2007-05-24 Thread 7stud
On May 24, 9:36 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, > > I am using timeit to time a global function like this > > t = timeit.Timer("timeTest()","from __main__ import timeTest") > result = t.timeit(); > > But how can i use timeit to time a function in a class? > class FetchUrlTh

Re: How can I time a method of a class in python using Timeit

2007-05-24 Thread vasudevram
On May 24, 8:36 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, > > I am using timeit to time a global function like this > > t = timeit.Timer("timeTest()","from __main__ import timeTest") > result = t.timeit(); > > But how can i use timeit to time a function in a class? > class FetchUrlTh

How can I time a method of a class in python using Timeit

2007-05-24 Thread [EMAIL PROTECTED]
Hi, I am using timeit to time a global function like this t = timeit.Timer("timeTest()","from __main__ import timeTest") result = t.timeit(); But how can i use timeit to time a function in a class? class FetchUrlThread(threading.Thread): def aFunction(self): # do something