利用 threading.Timer 启动方法

 1 import threading as thd
 2 import time
 3 
 4 
 5 def fn():
 6     print(time.time())
 7     thd.Timer(1, fn).start()
 8 
 9 
10 fn()

利用threading.Timer 间隔1s 启动fn()方法一次 等待过程中主进程不中断

posted on 2019-09-24 17:10  小黑崽  阅读(394)  评论(0编辑  收藏  举报

导航