摘要:JavaScript睡眠函数代码实例讲解JavaScript睡眠函数代码实例讲解

小宝典致力于为广大程序猿(媛)提供高品质的代码服务,请大家多多光顾小站,小宝典在此谢过。

JavaScript睡眠函数代码实例讲解

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

JavaScript睡眠函数代码实例讲解

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

觉得可用,就经常来吧!Javascript技巧 脚本宝典 欢迎评论哦! js技巧,巧夺天工,精雕玉琢。小宝典献丑了!

本文固定链接: http://www.js-code.com/js/js_1326.html