📜  如何在python代码示例中以间隔运行函数

📅  最后修改于: 2022-03-11 14:46:17.257000             🧑  作者: Mango

代码示例2
# this makes program sleep in intervals
from time import time, sleep
while True:
    sleep(1 - time() % 1) # run every 1 second... you can change that
    # thing to run