Re: How to use time.clock() function in python

2007-01-23 Thread Nick Craig-Wood
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I am following this python example trying to time how long does an > operation takes, like this: > > My question is why the content of the file (dataFile) is just '0.0'? > I have tried "print >>dataFile, timeTaken" or "print >>dataFile,str( > tim

Re: How to use time.clock() function in python

2007-01-22 Thread Steven D'Aprano
On Mon, 22 Jan 2007 15:32:58 -0800, samuel.y.l.cheung wrote: > File "/usr/lib/python2.4/timeit.py", line 188, in repeat > t = self.timeit(number) > File "/usr/lib/python2.4/timeit.py", line 161, in timeit > timing = self.inner(it, self.timer) > File "", line 6, in inner > NameError:

Re: How to use time.clock() function in python

2007-01-22 Thread samuel . y . l . cheung
Thanks. I have a fuction called 'func1'. def func1: # logic of the function When my script just call 'func1()' it works. func1() But when put it under timerit.Timer, like this: t = timeit.Timer("func1()","") t.repeat(1, 10) # want to time how long it takes to run 'func1' 10 times, I get a

Re: How to use time.clock() function in python

2007-01-22 Thread Steven D'Aprano
On Mon, 22 Jan 2007 14:05:16 -0800, [EMAIL PROTECTED] wrote: > Hi, > > I am following this python example trying to time how long does an > operation takes, like this: > > My question is why the content of the file (dataFile) is just '0.0'? > I have tried "print >>dataFile, timeTaken" or "print

Re: How to use time.clock() function in python

2007-01-22 Thread Gabriel Genellina
At Monday 22/1/2007 19:05, [EMAIL PROTECTED] wrote: I am following this python example trying to time how long does an operation takes, like this: My question is why the content of the file (dataFile) is just '0.0'? I have tried "print >>dataFile, timeTaken" or "print >>dataFile,str( timeTaken)

How to use time.clock() function in python

2007-01-22 Thread [EMAIL PROTECTED]
Hi, I am following this python example trying to time how long does an operation takes, like this: My question is why the content of the file (dataFile) is just '0.0'? I have tried "print >>dataFile, timeTaken" or "print >>dataFile,str( timeTaken)", but gives me 0.0. Please tell me what am I miss