By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,593 Members | 1,575 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,593 IT Pros & Developers. It's quick & easy.

Re: How to get high precision timer in python?

P: n/a
2008/10/29 James Mills <pr******@shortcircuit.net.au>:
On Wed, Oct 29, 2008 at 12:14 PM, <li**************@gmail.comwrote:
>I use python2.5 in WindowsXP. If using time.time() as timer, it seems

On the win32 platform should you not
be using time.clock vs. time.time ?
Well, whatelse can I use?

ShenLei
Oct 29 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"????" <li**************@gmail.comwrote:
>2008/10/29 James Mills <pr******@shortcircuit.net.au>:
>On Wed, Oct 29, 2008 at 12:14 PM, ???? <li**************@gmail.comwrote:
>>I use python2.5 in WindowsXP. If using time.time() as timer, it seems

On the win32 platform should you not
be using time.clock vs. time.time ?

Well, whatelse can I use?
I'm not sure you understood what he was saying. time.time() and
time.clock() can both be used for elapsed timing, but because of a fluke of
implementation, time.time() is more precise on Linux, and time.clock() is
more precise on Windows.

So, use time.clock().
--
Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Oct 29 '08 #2

P: n/a
On Wed, Oct 29, 2008 at 4:22 PM, Tim Roberts <ti**@probo.comwrote:
I'm not sure you understood what he was saying. time.time() and
time.clock() can both be used for elapsed timing, but because of a fluke of
implementation, time.time() is more precise on Linux, and time.clock() is
more precise on Windows.
That's exactly what I was getting at, only I couldn't
have been bothered explaining why! :)

--JamesMills
--
--
-- "Problems are solved by method"
Oct 29 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.