Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# Python 3.7+
import asyncio
async def sleep(id):
print("will sleep", id)
await asyncio.sleep(4)
print("slept", id)
async def main():
await asyncio.gather(sleep(1), sleep(2))
asyncio.run(main())
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.