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)

 

posted @ 2021-06-11 16:59  OTAKU_nicole  阅读(70)  评论(0编辑  收藏  举报