Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
speed-test
import requests
import time
proxies_original = {
'http': 'socks5://127.0.0.1:18081',
'https': 'socks5://127.0.0.1:18081'
}
proxies_my = {
'http': 'socks5://127.0.0.1:18080',
'https': 'socks5://127.0.0.1:18080'
}
url = "https://qd.myapp.com/myapp/qqteam/pcqq/QQ9.0.8_3.exe"
print("Start Download {}.".format(url))
st = time.time()
print(requests.get(url, proxies=proxies_original))
time_original = time.time()-st
print("[Original]Done {:.3f} seconds.".format(time_original))
url = "https://qd.myapp.com/myapp/qqteam/pcqq/QQ9.0.8_3.exe"
print("Start Download {}.".format(url))
st = time.time()
print(requests.get(url, proxies=proxies_my))
time_my = time.time()-st
print("[MY]Done {:.3f} seconds.".format(time_my))
print("==========\nOriginal: {:.5f} sec\nMy : {:.5f} sec\n==========\n".format(time_original, time_my))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.