线程定时器也是定时器,就是定时之后开启一条线程
''' 线程定时器,就是规定时间后开启一条线程 ''' def task(): print('线程执行了') time.sleep(2) print('线程结束了') t = Timer(4,task) # 间隔时间, 功能函数 t.start()