本站改版新增arduino频道
_thread
import time, _thread
def some_1(caller, delay):
print('some_fn called by', caller)
time.sleep(delay)
print('some_fn is finished')
def some_2(caller, delay):
print('some_fn called by', caller)
time.sleep(delay)
print('some_fn is finished')
_thread.start_new_thread(some_1, ('main program1', 2))
_thread.start_new_thread(some_2, ('main program2', 2))
print('main program called some_fn & continues')
time.sleep(3)
print('main program still running')
Copyright © 2014 ESP56.com All Rights Reserved
晋ICP备14006235号-22 晋公网安备14108102001165号
执行时间: 0.0094819068908691 seconds