26 lines
530 B
Python
Raw Normal View History

2023-05-16 21:49:05 +08:00
import eventloop
from PikaStdLib import MemChecker
import time
eventloop._is_debug = True
expect_finished = 10
finished = 0
def test_func(arg1, arg2):
global finished
finished += 1
print("finished:", finished)
print("Running test function with arguments:", arg1, arg2)
MemChecker().now()
MemChecker().now()
for i in range(expect_finished):
eventloop.start_new_task_once(
test_func, ("Hello", " World"))
MemChecker().now()
while finished < expect_finished:
time.sleep(0.1)
eventloop.stop()