2023-05-17 21:44:46 +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(
|
2023-06-06 03:28:21 +08:00
|
|
|
test_func, ("Hello", " World"), delay_ms=10)
|
2023-05-17 21:44:46 +08:00
|
|
|
MemChecker().now()
|
|
|
|
|
|
|
|
while finished < expect_finished:
|
|
|
|
time.sleep(0.1)
|
|
|
|
eventloop.stop()
|