Javascript的sleep函数

转载自知乎

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

5 thoughts on “Javascript的sleep函数”

Leave a Reply

Your email address will not be published. Required fields are marked *