运维网's Archiver
论坛
›
Python
› python 定时器(Timer)
Q132284591
发表于 2017-5-1 07:27:57
python 定时器(Timer)
# encoding: UTF-8
import threading
#Timer(定时器)是Thread的派生类,用于在指定时间后调用一个方法。
def func():
print 'hello timer!'
timer = threading.Timer(5, func)
timer.start()
页:
[1]
查看完整版本:
python 定时器(Timer)