TensorGuy01 commited on
Commit
4021684
·
verified ·
1 Parent(s): d27327a

Create speedtest.py

Browse files
Files changed (1) hide show
  1. speedtest.py +14 -0
speedtest.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import time
2
+ import requests
3
+
4
+ data = b"x" * 10_000_000 # 10 MB
5
+
6
+ start = time.time()
7
+ response = requests.post("https://httpbin.org/post", data=data)
8
+ end = time.time()
9
+
10
+ duration = end - start
11
+ speed_mbps = (len(data) * 8) / (duration * 1_000_000)
12
+
13
+ print(f"Upload time: {duration:.2f} seconds")
14
+ print(f"Estimated outbound upload speed: {speed_mbps:.2f} Mbps")