JSFiddle - React, Tailwind, and code Playground
by rlemon
JavaScript
var timestamp = (new Date()).getTime();
function run() {
var now = (new Date()).getTime();
if( now - timestamp >= 1000 ) {
console.log( 'tick' );
timestamp = now;
}
setTimeout(run, 10);
}
run();