Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

_

    function blockingSleep(amt) {
        let start = new Date().getTime()
        while (start + amt > new Date().getTime()) {}

    }


This 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: