首页 > 代码库 > javascript中sleep等待实现

javascript中sleep等待实现

function sleep(milliSeconds) {var startTime = new Date().getTime();while (new Date().getTime() < startTime + milliSeconds);}sleep(10000);

 

javascript中sleep等待实现