Skip to content

Instantly share code, notes, and snippets.

@bugaevc bugaevc/
Last active Aug 29, 2015

What would you like to do?
from tornado.httpclient import AsyncHTTPClient
import tornado.gen
import tornado.ioloop
import timeit
def make_request(index):
client = AsyncHTTPClient()
print(index, 'started')
response = yield client.fetch('', raise_error=False)
print(index, response.code)
def main():
yield [make_request(i) for i in range(5)]
print(timeit.timeit(lambda: tornado.ioloop.IOLoop.current().run_sync(main), number=1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.