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', now - timestamp );
         timestamp = now;
     }

     setTimeout(run, 1);
}
run();