#Save these codes and rename example.py.
#found url.txt in the same menu like example.py.
#input your urls in url.txt with line feed.
import requests
import os
#import functools
#import time
def spend(web):
r = requests.get(web)
return r.elapsed.total_seconds()
with open('url.txt','r')as f:
url=f.read().splitlines()
sudu=list(map(spend,url))
zidian=dict(zip(url,sudu))
sort=sorted(zidian.items(),key=lambda e:e[1])
for a,b in sort:
print(a," 的响应时间为 ",b,"秒")