线程的定时器Timer

定时器的作用就是多少秒之后开启一个线程。

from threading import Timer


def func():
    print('函数执行了')


Timer(2, func).start()

注意这里的Timer是异步的。

原文地址:https://www.cnblogs.com/aaronthon/p/9861150.html