diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/simult.py | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/tests/simult.py b/tests/simult.py index 61a3792..49d3e4b 100644 --- a/tests/simult.py +++ b/tests/simult.py @@ -1,20 +1,17 @@ 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 count(): + print("before") + await asyncio.sleep(3) + print("after") async def main(): - await asyncio.gather(count(1), count(2), count(3)) + await asyncio.gather(count(), count(), count()) + i = 0 + while i < 3000000: + i += 1 print("done") asyncio.run(main()) |
