Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import asyncio
- async def update():
- while True:
- await asyncio.sleep(0.1)
- print("update")
- async def play_game():
- for _ in range(100):
- print("game")
- await asyncio.sleep(1)
- def main():
- loop = asyncio.get_event_loop()
- loop.create_task(update())
- loop.run_until_complete(play_game())
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement