Skip to content

Instantly share code, notes, and snippets.

@thejohnfreeman
Created April 10, 2021 00:09
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 thejohnfreeman/d7c55844da23a4157a710dec7f0c829c to your computer and use it in GitHub Desktop.
Save thejohnfreeman/d7c55844da23a4157a710dec7f0c829c to your computer and use it in GitHub Desktop.
import asyncio
async def message(delay):
await asyncio.sleep(delay)
print(delay, flush=True)
async def main():
task = asyncio.create_task(message(2))
await message(1)
asyncio.run(main())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment