function sleep(delay) {
var start = new Date().getTime();
while (new Date().getTime() - start < delay) {
continue;
}
}
function test() {
console.log('111');
sleep(2000);
console.log('222');
}
test()
function sleep(delay) {
var start = new Date().getTime();
while (new Date().getTime() - start < delay) {
continue;
}
}
function test() {
console.log('111');
sleep(2000);
console.log('222');
}
test()
本文标题:sleep 函数
本文链接:https://www.haomeiwen.com/subject/nfuthjtx.html
网友评论