I want to execute some JS code every hour. But I can't use
setInterval("javascript function",60*60*1000);
because I want to do it every full hour, I mean in 1:00, in 2:00, in 3:00 and so on. I am thinking about something like
var d;
while(true) {
d = new Date();
if ((d.getMinutes() == '00') && (d.getSeconds() == '00')){
// my code here
}
}
but it's too slow and it doesn't work well.
Thak you for any ideas
from JavaScript: How to do something every full hour?
No comments:
Post a Comment