I am trying to update information from a weather service on my page.(我正在尝试更新页面上的气象服务信息。)
The info should be updated every hour on the hour.(该信息应每小时更新一次。) How exactly do I go about calling a function on the hour every hour?(我该如何每小时每小时精确地调用一个函数?)
I kind of had an idea but im not sure of how to actually refine it so it works... What I had in mind was something like creating an if statement, such as: (pseudo code)(我有点主意,但是我不确定如何真正地对其进行改进……我想到的就是创建一个if语句,例如:(伪代码))
//get the mins of the current time
var mins = datetime.mins();
if(mins == "00"){
function();
}
ask by user2961971 translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…