JSFiddle - React, Tailwind, and code Playground
by tara5
JavaScript
var startTime = Date.now(),
timeOut = 3000,
currentSecond = 1000,
currentValue;
while(true) {
currentValue = Date.now();
if (currentValue >= startTime + currentSecond) {
console.log(currentSecond/1000);
currentSecond += 1000;
}
if (currentValue >= startTime + timeOut) {
break;
}
}