Skip to content

Instantly share code, notes, and snippets.

@ihciah
Created January 9, 2019 11:01
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ihciah/bda1fab5dc1a8d0f70d7b0199f46169a to your computer and use it in GitHub Desktop.
Save ihciah/bda1fab5dc1a8d0f70d7b0199f46169a to your computer and use it in GitHub Desktop.
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