JSFiddle - React, Tailwind, and code Playground

by booktu8

JavaScript

var start = null;

function step(timestamp) {
  if (!start) start = timestamp;
  var progress = timestamp - start;
  console.log(Date.now() / 1000)
  if (progress < 2000) {
    window.requestAnimationFrame(step);
  }
}

window.requestAnimationFrame(step);