hundreds of seconds?

eur.van.andel at gmail.com eur.van.andel at gmail.com
Wed Oct 11 11:38:28 EDT 2006


Michael.Coll-Barth at VerizonWireless.com wrote:
> > -----Original Message-----
> > From: eur.van.andel at gmail.com
>
> > How can I access partial seconds on the system clock?
>
> What is wrong with time.time()?

Absolutely nothing.



> >>> import time
> >>> time.time()
> 1160578386.0109401
> >>> time.time()
> 1160578386.87324
> >>> time.time()
> 1160578387.5790291
> >>> x = time.time()
> >>> y = time.time()
> >>> z = y-x
> >>> z
> 4.6488111019134521

That was just what I needed. I was just ignorant, that's all.


> The difference between x and y is the number of seconds between 'polling's of the OS.  There are some issues with precision.

G5-fiwihex:~ eur$ python
Python 2.3.5 (#1, Mar 20 2005, 20:38:20)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1809)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> time.time()
1160580871.258379
>>>

My G5 has lots of digits behind the decimal point, my measuring PC runs
W98. We'll see how it does there. But I trust it to be enough digits.


Thanks.




More information about the Python-list mailing list