Re: Demo/sockets/throughput.py traceback

Guido.van.Rossum@cwi.nl
Thu, 17 Feb 1994 10:33:36 +0100

> From: Jeff Blaine <jblaine@ciesin.org>
>
> Python 1.0.1 from ftp.cwi.nl (Feb 16)
> -------------------------------------
>
> hosta> python throughput.py -s 9000
> Server ready...
>
>
> hostb> python throughput.py -c 20 hosta 9000
> Traceback (innermost last):
> File "throughput.py", line 93
> main()
> File "throughput.py", line 29
> client()
> File "throughput.py", line 72
> t1 = time.millitimer()
> AttributeError: millitimer

Oops -- obviously the demo is broken. Instead of time.millitimer(),
use time.time(), which returns the time in seconds as a float with as
much precision as the system cares to return it (the implementation
chooses between gettimeofday(), ftime() and time() depending on
availability). You will have to adapt the output formatting as well;
I used:

print 'Throughput:', round((BUFSIZE*count*0.001) / (t5-t1), 3),

Of course this will be fixed in 1.0.2 (as will all other remaining
references to millitimer in the Demo and Doc directories).

--guido van Rossum, CWI, Amsterdam <Guido.van.Rossum@cwi.nl>
URL: <http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>