sleep: function(time){
var now = new Date();
var exitTime = now.getTime() + time;
while(true){
now=new Date();
console.log("休眠中...");
if (now.getTime() > exitTime)
return;
}
},
时间: 2024-10-10 14:34:36
sleep: function(time){
var now = new Date();
var exitTime = now.getTime() + time;
while(true){
now=new Date();
console.log("休眠中...");
if (now.getTime() > exitTime)
return;
}
},