其他分享
首页 > 其他分享> > tomorrow多线程启动

tomorrow多线程启动

作者:互联网

import time
from tomorrow import threads

@threads(3)
def print_thread(i):
    time.sleep(2)
    print(time.strftime("%H:%M:%S"),i,"执行完毕")


list = {
    'AAA',
    'BBB',
    'CCC',
}

if __name__ == '__main__':
    for i in list:
        print(time.strftime("%H:%M:%S"),"启动:", i)
        print_thread(i)
        time.sleep(0.5)

 

标签:__,thread,启动,list,sleep,time,print,多线程,tomorrow
来源: https://www.cnblogs.com/nicole-zhang/p/14875795.html