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()方法一次 等待过程中主进程不中断
利用 threading.Timer 启动方法
原文:https://www.cnblogs.com/ltn26/p/11579428.html