# echoclient.py from socket import * import time CHUNKSIZE = 8192 NUMMESSAGES = 1280 # Total of 10MB # Dummy message msg = b"x"*CHUNKSIZE # Connect and send messages s = socket(AF_INET,SOCK_DGRAM) start = time.time() for n in range(NUMMESSAGES): s.sendto(msg,("",16000)) msg, addr = s.recvfrom(65536) end = time.time() print("%0.3f seconds (%0.3f bytes/sec)" % (end-start, (CHUNKSIZE*NUMMESSAGES)/(end-start)))