您好,登錄后才能下訂單哦!
import threading
import time
def loop01(in01):
print("start loop01 at : {0}".format(time.ctime()))
print("loop01參數:{0}".format(in01))
time.sleep(4)
print("end loop01 at : {0}".format(time.ctime()))
def loop02(in01, in02):
print('start loop02 at : {0}'.format(time.ctime()))
print("loop02參數,第一個參數{0},第二個參數{1}".format(in01,in02))
time.sleep(2)
print("end loop02 at : {0}".format(time.ctime()))
if name == 'main':
print("Starting at : {0}".format(time.ctime()))
t1 = threading.Thread(target=loop01,args=("loop01參數",))
t2 = threading.Thread(target=loop02,args=("loop02參數1","loop02參數2"))
t1.start()
t2.start()
t1.join()
t2.join()
print("All done at {0}".format(time.ctime()))
while True:
time.sleep(10)
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。