1. 程式人生 > >吳裕雄 python深度學習與實踐(3)

吳裕雄 python深度學習與實踐(3)

strftime print sleep .com 實踐 info str def col

import threading, time

def doWaiting():
    print(start waiting:, time.strftime(%S))
    time.sleep(3)
    print(stop waiting, time.strftime(%S))
thread1 = threading.Thread(target = doWaiting)
thread1.start()
time.sleep(1)  #確保線程thread1已經啟動
print(start join)
thread1.join() #將一直堵塞,直到thread1運行結束。
print(end join)

技術分享圖片

吳裕雄 python深度學習與實踐(3)