function sleep(sleepDuration) {
var now = new Date().getTime();
while(new Date().getTime() < now + sleepDuration){ /* Do nothing */ }
}
参考链接:https://stackoverflow.com/questions/951021/what-is-the-javascript-version-of-sleep
function sleep(sleepDuration) {
var now = new Date().getTime();
while(new Date().getTime() < now + sleepDuration){ /* Do nothing */ }
}
参考链接:https://stackoverflow.com/questions/951021/what-is-the-javascript-version-of-sleep