def main(): # create an ioloop, do the above, then stop import time start = time.time() for _ in range(10000): ioloop.IOLoop.current().run_sync(communicate) end = time.time() print((end - start))