import threading,time,requests
run_times = []
def blog():
start_time = time.time()
r = requests.get('http://www.nnzhp.cn').text # 测试场景
end_time = time.time()
run_time = end_time - start_time
run_times.append(run_time)
objs = []
for i in range(100): # 并发数
t = threading.Thread(target = blog)
objs.append(t)
t.start()
for obj in objs:
# print(obj)
obj.join()
avg = sum(run_times)/len(run_times) # 平均响应时间
print(avg)