473,408 Members | 1,746 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,408 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 4188
"????" <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...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.