473,407 Members | 2,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Re: How to get high precision timer in python?

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
2 4187
"????" <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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

75
by: Howard Nease | last post by:
Hello, everyone. I would appreciate any advice that someone could give me on my future career path. Here is my situation: I am a bright Junior in a very well-respected private high school, taking...
3
by: Szabolcs Nagy | last post by:
I have to measure the time of a while loop, but with time.clock i always get 0.0s, although python manual sais: "this is the function to use for benchmarking Python or timing algorithms" So i...
2
by: Michael Evans | last post by:
Anyone, I'm looking for a way to setup a callback function in our VC++ .ne 2003 7.1 console application using a higher resolution timer. Th multimedia timer is too low resolution at 1...
15
by: Donkey | last post by:
Hi, The precision of built-in date type of C is very low. Even using long double float type or double float type, we can only use 12 or 16 digits after the decimal point. What can we do if we want...
23
by: Arnaud Delobelle | last post by:
Hi all, I want to know the precision (number of significant digits) of a float in a platform-independent manner. I have scoured through the docs but I can't find anything about it! At the...
19
by: John | last post by:
The table below shows the execution time for this code snippet as measured by the unix command `time': for i in range(1000): time.sleep(inter) inter execution time ideal 0 ...
7
by: GCRhoads | last post by:
I'm looking for a very basic high-precision arithmetic library. I need to be able to specify a fixed number of bits or decimal digits (32 decimal digits should be all I need). The only arithmetic...
10
by: ratcharit | last post by:
Currently using cosine function in math.h Currently I get: 1 = cos(1e^-7) Is there another way for cos to return value of high accuracy say: 0.999999 = cos(1e^-7)
0
by: =?GB2312?B?zPC5zw==?= | last post by:
Howdy, I use python2.5 in WindowsXP. If using time.time() as timer, it seems the maximum precision is about 10-12ms. Maybe this is caused by the time slice defined in process scheduler. However,...
0
by: James Mills | last post by:
On Wed, Oct 29, 2008 at 12:14 PM, 甜瓜 <littlesweetmelon@gmail.comwrote: On the win32 platform should you not be using time.clock vs. time.time ? --JamesMills -- -- -- "Problems are...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.