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.
"[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
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
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
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
[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
[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
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