def test_speed_1024(): start_time = time.perf_counter() agent = CAgent("stallman.org", 443) agent.uri = "/" agent.make_header() agent.buffer_size = 1024 resp = agent.request() end_time = time.perf_counter() print("Time for buffer size 1024: " + str(end_time - start_time))
def test_redirect(): start_time = time.perf_counter() agent = CAgent("cutt.ly", 443) agent.uri = "/FeyXNVr" agent.make_header() agent.buffer_size = 16384 resp = agent.request() #print(resp) end_time = time.perf_counter() print("Time for redirect: " + str(end_time - start_time))