javascript下的等待函数
【代码】javascript下的等待函数。
·
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
更多推荐

所有评论(0)