线程定时器也是定时器,就是定时之后开启一条线程

二、用法

'''
线程定时器,就是规定时间后开启一条线程
'''
def task():
    print('线程执行了')
    time.sleep(2)
    print('线程结束了')

t = Timer(4,task)   # 间隔时间, 功能函数
t.start()

相关文章:

  • 2022-01-01
  • 2021-12-18
猜你喜欢
  • 2022-12-23
  • 2021-10-13
  • 2022-01-04
相关资源
相似解决方案