老师,帮忙看一下,为什么用并发的方式与同步方式的时间是一样的,不知道哪儿出错了
import tornado.ioloop from tornado.httpclient import AsyncHTTPClient N = 3 URL = "http://127.0.0.1:8888/sleep" async def main(): http_client = AsyncHTTPClient() responses = [await http_client.fetch(URL) for i in range(N)] start_time = time.time() tornado.ioloop.IOLoop.current().run_sync(main) print("async", time.time() - start_time) beg = time.time() for i in range(N): requests.get(URL) print(time.time() - beg)