mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-22 17:12:55 +08:00
26 lines
530 B
Python
26 lines
530 B
Python
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()
|