3 ms·
_ function blockingSleep(amt) { let start = new Date().getTime() while (start + amt > new Date().getTime()) {} }
by huem0n 2y ago
_
function blockingSleep(amt) {
let start = new Date().getTime()
while (start + amt > new Date().getTime()) {}
}
- arctek 2y agoThis is horrible - I love it. I did forget you could do this, though I'm fairly sure in the case of a browser (at least it used to) this will block the entire UI.