bytes/sec

Steven Adams adams_s at lab.eng.usyd.edu.au
Sat Aug 12 07:08:41 EDT 2000


*idle musings*

You could just sit inside a loop, each iteration accepting upto a maximum
number of bits, and measuring the time it takes for each block of data to
arrive.

e.g.   using socket and time

 while 1:
    t1=time.clock()
    data = conn.recv(BLOCK_SIZE_IN_BITS)
    bps = BLOCK_SIZE_IN_BITS / (time.clock() - t1) #calculate rate of bits
per second
    if not data: break

maybe that works, or can be adapted

Steven

offi at softhome.net> wrote in message
news:3993D5ED2C6.30C1ETOFFI at smtp.softhome.net...
> is there any pre-existing code that shows how to calculate bytes/sec
> download rates a la slrnpull and browser download boxes?
>
> --
> etoffi
>
>





More information about the Python-list mailing list