1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00
iiab/roles/xsce-admin/files/cmdsrv/scripts/get_inet_speed
2017-05-27 11:09:50 -07:00

17 lines
335 B
Python

#!/usr/bin/python
import time
import subprocess
t1 = time.time()
rc = subprocess.call(["wget", "http://cachefly.cachefly.net/10mb.test", "-q", "-O", "/dev/null"])
t2 = time.time()
if rc == 0:
t3 = t2 - t1
speed = 10/t3
print "Time for 10MB was %f; Speed was %f MB/s" % (t3, speed)
else:
print "Speed Test Failed."