How to get high precision timer in python?

Tim Roberts timr at probo.com
Wed Oct 29 02:22:10 EDT 2008


"????" <littlesweetmelon at gmail.com> wrote:

>2008/10/29 James Mills <prologic at shortcircuit.net.au>:
>> On Wed, Oct 29, 2008 at 12:14 PM, ???? <littlesweetmelon at gmail.com> wrote:
>>> 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, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the Python-list mailing list