Skip to content

Instantly share code, notes, and snippets.

@kunigami
Last active February 2, 2020 04:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kunigami/bb8319500a319656e649eea1a0fc3dcc to your computer and use it in GitHub Desktop.
Save kunigami/bb8319500a319656e649eea1a0fc3dcc to your computer and use it in GitHub Desktop.
# 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