Re: time.clock() or time.time()

2005-08-05 Thread Magnus Lycka
Shane Hathaway wrote: > However, isn't this thoroughly un-Pythonic? No wonder people have to > ask. Only if they've never read K&R, and I thought that was compulsory! ;^) There are a few python libraries, such as time and math, that are basically just thin wrappers around standard C libraries.

Re: time.clock() or time.time()

2005-08-03 Thread Nelson Minar
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > I'm trying to benchmark some function calls for Zope project Other folks have explained time() vs. clock(), so I'll leave that. But rather than roll your own timer functions, consider using timeit. -- http://mail.python.org/mailman/listinfo/pyth

Re: time.clock() or time.time()

2005-08-03 Thread Shane Hathaway
Magnus Lycka wrote: > Shane Hathaway wrote: > >>time.time() measures real time, while time.clock() measures the time the >>CPU dedicates to your program. > > > I suppose that varies with the platform... "help(time.clock)" says: > > Help on built-in function clock: > > clock(...) > clock

Re: time.clock() or time.time()

2005-08-02 Thread Peter Hansen
Magnus Lycka wrote: > On Windows, you're likely to prefer time.clock(), to > measure relative times, since time.time() will have too low resolution > for measuring short thingies. Specifically, using the NT/XP family of Windows operating systems time.time() has a resolution of approximately 0.01

Re: time.clock() or time.time()

2005-08-02 Thread Magnus Lycka
Shane Hathaway wrote: > time.time() measures real time, while time.clock() measures the time the > CPU dedicates to your program. I suppose that varies with the platform... "help(time.clock)" says: Help on built-in function clock: clock(...) clock() -> floating point number Return t

Re: time.clock() or time.time()

2005-08-02 Thread Leonhard Vogt
[EMAIL PROTECTED] schrieb: > What's the difference between time.clock() and time.time() > (and please don't say clock() is the CPU clock and time() is the actual > time because that doesn't help me at all :) clock (depending on the platform ?) measures the time spent by your program. Time gives y

Re: time.clock() or time.time()

2005-08-02 Thread Shane Hathaway
[EMAIL PROTECTED] wrote: > What's the difference between time.clock() and time.time() > (and please don't say clock() is the CPU clock and time() is the actual > time because that doesn't help me at all :) > > I'm trying to benchmark some function calls for Zope project and when I > use t0=time.cl

time.clock() or time.time()

2005-08-02 Thread [EMAIL PROTECTED]
What's the difference between time.clock() and time.time() (and please don't say clock() is the CPU clock and time() is the actual time because that doesn't help me at all :) I'm trying to benchmark some function calls for Zope project and when I use t0=time.clock(); foo(); print time.clock()-t0 I