[英]python threading.Timer start immediately not at specified time
i want to execute a function in every 3 second the code works if i call a function without arguments like below: 如果我调用一个没有如下参数的函数,我想每隔3秒执行一次函数代码:
def mytempfunc():
print "this is timer!"
threading.Timer(5, mytempfunc).start()
but if i call a function with argument like this: 但如果我用这样的参数调用一个函数:
def myotherfunc(a,b,c,d):
print "this is timer!"
threading.Timer(5, myotherfunc(a,b,c,d)).start()
the new thread will be created and started immediately without waiting for 5 seconds. 新线程将立即创建并启动,无需等待5秒钟。 is there anything that i missed? 有什么我错过的吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.