0 points

SET INTERVAL


dashboard

Fri Nov 13 2020 21:38:29 GMT+0000 (UTC)

Posted by @mvieira #javascript

function tick() {
  //get the mins of the current time
  var mins = new Date().getMinutes();
  if (mins == "00") {
    alert('Do stuff');
  }
  console.log('Tick ' + mins);
}

setInterval(tick, 1000);
content_copy Copy

https://stackoverflow.com/questions/19847412/how-to-call-a-function-every-hour