from tornado import httpclient
import time
start = time.time()
for x in range(1000):
httpclient.AsyncHTTPClient().fetch("https://www.google.com", method="GET")
print ('{0} seconds'.format(time.time() - start))
Result 1.11500000954 seconds
I wrote this to see how fast I can send 1000 requests to any site (I chose google) and I don't know why, but I feel like I did something wrong and its not actually going this quick, if I did do something wrong, could someone point out my error?
Thank you!
Well, yes, you spun off 1000 asynchronous requests to Google and timed that. You did not, however, time the overhead of actually making the HTTP call. That would require a callback-type of handler.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With