response time

John J. Lee jjl at pobox.com
Mon Nov 10 17:35:08 EST 2003


Alex Martelli <aleax at aleax.it> writes:

> José wrote:
> 
> > I'm programming a simple script to calculate response time from one
> > server to another server.
[...]
> > I can only calculate it in seconds, is there a way to do it in
> > miliseconds?
> 
> After "import time", time.time() returns the time (elapsed since an
> arbitrary epoch) with the unit of measure being the second, but the
> precision being as high as the platform on which you're running will
> allow.  The difference between two results of calling time.time() is
[...]

Also note that Windows' time(), in particular, has a precision of only
around 50 milliseconds (according to Tim Peters, so I haven't bothered
to test it myself ;-).  Pretty strange.


John




More information about the Python-list mailing list