console.log("我执行了");
sleep(3000);
console.log("我3000ms后执行了");
function sleep(numberMillis) {
var now = new Date();
var exitTime = now.getTime() + numberMillis;
while (true) {
now = new Date();
if (now.getTime() > exitTime)
return;
}
}
版权声明:本文为fay462298322原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。