每5秒调用一次函数 [英] call a function every 5 seconds
本文介绍了每5秒调用一次函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想每隔5秒调用一次功能,是否可以?
怎么样?
干杯!
Claudi
***通过Developersdex发送 http://www.developersdex.com ***
Hi,
I want to call a function every 5 seconds, is it possible?
How to?
Cheers!
Claudi
*** Sent via Developersdex http://www.developersdex.com ***
推荐答案
那么,你可以设置一个定时器,每5秒钟打一次,并处理被解雇的
事件?有两个这样的计时器取决于它是否是
用于winform或服务器使用。
或者,你可以让一个工作线程循环使用Sleep(5000 )?
Marc
Well, you can have a timer set to tick every 5 seconds, and handle the
event that gets fired? There are two such timers depending on whether it
is for winform or server usage.
Alternatively, you could have a worker thread looping with a Sleep(5000)?
Marc
是一个网页,你有一个关于如何设置tick的代码示例<每5秒钟
?
干杯!
Claudi
***通过开发人员发送的指南 http://www.developersdex.com ***
Is a web page, do you have a example of the code on how to set the tick
for every 5 seconds?
Cheers!
Claudi
*** Sent via Developersdex http://www.developersdex.com ***
在客户端?那么有一些javascript方法可以在
浏览器中执行此操作 - setInterval / setTimeout:
http://www.google.com/search?q=setInterval+asp.net
Marc
At client side? Well there are javascript ways of doing this in the
browser - setInterval / setTimeout:
http://www.google.com/search?q=setInterval+asp.net
Marc
这篇关于每5秒调用一次函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文