asyncio sleep in python

main.py
import asyncio

async def main():
    print('Sleeping for 2 seconds')
    await asyncio.sleep(2)
    print('Awake!')

asyncio.run(main())
138 chars
9 lines

related categories

gistlibby LogSnag