hundreds of seconds?
Hi all How can I access partial seconds on the system clock? I measure air speed and water flow in a heat-exchanger test stand and count pulses from both water meter and air speed meter. I divide the amount of these counts over a certain interval with the time of that interval. Since I only have seconds, I need to wait 100 seconds for may calculation is I want a precision of 1%. The radiator fan that I use can't stand these long intervals, 'cause I run it with 24V and 50 Amps to get decent airflow (10m/s) through my heat exchanger. Again: how do I get the hundreds of seconds from the system clock? In Pascal it was: GetTime( Hr1, Min1, Sec1, cSec1); (yes, I'm that old). --- ir EE van Andel [EMAIL PROTECTED] www.fiwihex.nl Fiwihex B.V. Wierdensestraat 74, NL7604BK Almelo, Netherlands tel+31-546-491106 fax+31-546-491107 -- http://mail.python.org/mailman/listinfo/python-list
Re: hundreds of seconds?
[EMAIL PROTECTED] wrote: > > -Original Message- > > From: [EMAIL PROTECTED] > > > 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. -- http://mail.python.org/mailman/listinfo/python-list