I want to combine the functions of the following 2 scripts, for example, the first refresh time is 23:00:00 (need to be accurate to milliseconds), and then refresh every 200 milliseconds, how to do it?
function refreshAt(hours, minutes, seconds) {
var now = new Date();
var then = new Date();
if(now.getHours() > hours ||
(now.getHours() == hours && now.getMinutes() > minutes) ||
now.getHours() == hours && now.getMinutes() == minutes && now.getSeconds() >= seconds) {
then.setDate(now.getDate() + 1);
}
then.setHours(hours);
then.setMinutes(minutes);
then.setSeconds(seconds);
var timeout = (then.getTime() - now.getTime());
setTimeout(function() { window.location.reload(true); }, timeout);
}
refreshAt(23,00,00);
timeout=prompt("Set timeout (Second):");
count=0
current=location.href;
if(timeout>0)
setTimeout('reload()',1000*timeout);
else
location.replace(current);
function reload(){
setTimeout('reload()',1000*timeout);
count++;
console.log('every('+timeout+')secondrefresh automatically,refresh times:'+count);
fr4me='<frameset cols='*'>n<frame src=''+current+''/>';
fr4me+='</frameset>';
with(document){write(fr4me);void(close())};
}