JSFiddle - React, Tailwind, and code Playground

by ysuper

HTML

sleep n second

JavaScript

function sleep(delay) {
    var start = new Date().getTime();
    while (new Date().getTime() < start + delay){}
}

console.log('start');
sleep(5000);
console.log('end');