Re: How to measure execution time of a program

2006-06-28 Thread Fredrik Lundh
Grant Edwards wrote: >> You can get better resolution by using time.clock() instead of >> time.time(). > > Oh really? When I do it, time.clock() is worse: on Unix, time.clock() is a tick counter; if your process is running when the tick interrupt arrives, the internal counter value is increment

Re: How to measure execution time of a program

2006-06-28 Thread Grant Edwards
On 2006-06-28, Pete Forman <[EMAIL PROTECTED]> wrote: > "Fredrik Lundh" <[EMAIL PROTECTED]> writes: > > simplest way: > > > > t0 = time.time() > > You can get better resolution by using time.clock() instead of > time.time(). Oh really? When I do it, time.clock() is worse: ---

Re: How to measure execution time of a program

2006-06-28 Thread Wolfram Kraus
On 28.06.2006 10:01, Girish Sahani wrote: > Sorry for spamming again, but please also enlighten me with some way to > time a function i.e. to find out how much time each function takes for > execution in a big program. >> Hi all, >> >> Can anyone tell me the simplest way to do it (some code snipp

Re: How to measure execution time of a program

2006-06-28 Thread Fredrik Lundh
Pete Forman wrote: > > t0 = time.time() > > You can get better resolution by using time.clock() instead of > time.time(). depends on the platform, and whether you want wall time or process time. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to measure execution time of a program

2006-06-28 Thread Pete Forman
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > simplest way: > > t0 = time.time() You can get better resolution by using time.clock() instead of time.time(). -- Pete Forman-./\.- Disclaimer: This post is originated WesternGeco -./\.- by myself and does no

Re: How to measure execution time of a program

2006-06-28 Thread Girish Sahani
Sorry for spamming again, but please also enlighten me with some way to time a function i.e. to find out how much time each function takes for execution in a big program. > Hi all, > > Can anyone tell me the simplest way to do it (some code snippet that > could be included in the program's main f

Re: How to measure execution time of a program

2006-06-28 Thread Fredrik Lundh
Girish Sahani wrote: > Can anyone tell me the simplest way to do it (some code snippet that > could be included in the program's main function) ?? simplest way: t0 = time.time() main() print time.time() - t0, "seconds" (assuming that you want to measure wall time, and that your prog

How to measure execution time of a program

2006-06-28 Thread Girish Sahani
Hi all, Can anyone tell me the simplest way to do it (some code snippet that could be included in the program's main function) ?? Thanks, girish -- http://mail.python.org/mailman/listinfo/python-list