pikapython/examples/_thread/thread_issue1.py

15 lines
182 B
Python
Raw Normal View History

2024-08-03 17:05:14 +08:00
import time
import _thread
def task2():
while True:
print("123")
time.sleep_ms(2001)
_thread.start_new_thread(task2, ())
while True:
time.sleep_ms(2000)