28 lines
483 B
Python
28 lines
483 B
Python
import asyncio
|
|
from typing import Never
|
|
|
|
|
|
async def print_nums() -> Never:
|
|
num = 1
|
|
while True:
|
|
num += 1
|
|
print(num)
|
|
await asyncio.sleep(0.1)
|
|
|
|
|
|
async def print_time() -> Never:
|
|
count = 0
|
|
while True:
|
|
if not count % 3:
|
|
print(f"Time {count}")
|
|
count += 1
|
|
await asyncio.sleep(1)
|
|
|
|
|
|
async def main() -> Never:
|
|
await asyncio.gather(print_nums(), print_time())
|
|
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(main())
|