js延迟

function sleep(numberMillis) {
var now = new Date();
var exitTime = now.getTime() + numberMillis;
while (true) {
now = new Date();
if (now.getTime() > exitTime)
return;
}
}

posted @ 2018-02-08 12:36  zzzp0755  阅读(103)  评论(0编辑  收藏  举报
今天的苦果,是昨天的伏笔,当下的付出,才是明日的花开!加油!!!加油!!!