threading.Timer

来源:互联网 发布:linux 压缩文件夹 命令 编辑:程序博客网 时间:2024/05/29 16:01

threading.Timer

  threading.Timer是threading.Thread的子类,可以在指定时间间隔后执行某个操作。下面是Python手册上提供的一个例子:

[python] view plaincopy
  1. def hello():  
  2.     print "hello, world"  
  3. t = Timer(3, hello)  
  4. t.start() # 3秒钟之后执行hello函数。  

0 0
原创粉丝点击