summaryrefslogtreecommitdiff
path: root/tests/simult.py
blob: 61a3792f4188360394d58e5bc748fdaf4b7c62d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import asyncio
import time


async def count(x):
    i = 0
    await asyncio.sleep(2)
    while i < 100000:
        z = x * x
        z = z * z
        z = z * z
        i += 1
    return z


async def main():
    await asyncio.gather(count(1), count(2), count(3))
    print("done")

asyncio.run(main())