Created
January 9, 2019 11:01
-
-
Save ihciah/bda1fab5dc1a8d0f70d7b0199f46169a to your computer and use it in GitHub Desktop.
speed-test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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