Last active
August 20, 2017 22:53
-
-
Save pfreixes/233fd8c6a6ec82f2cde4688a2976bf2d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import time | |
async def coro(): | |
await asyncio.sleep(0) | |
async def main(loop, coros): | |
start = loop.time() | |
for i in range(coros): | |
await coro() | |
dt = loop.time() - start | |
print("Coros per second: {}".format(coros/dt)) | |
loop = asyncio.get_event_loop() | |
loop.run_until_complete(main(loop, 400000)) |
Author
pfreixes
commented
Aug 20, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment