function sleep(numberMillis) { var now = new Date(); var exitTime = now.getTime() + numberMillis; while (true) { now = new Date(); if (now.getTime() > exitTime) return; } }
js 自定义方法 实现停留几秒 sleep
原文:http://www.cnblogs.com/chen-lhx/p/5083704.html