/*
* This function will not return until (at least)
* the specified number of milliseconds have passed.
* It does a busy-wait loop.
*/
function pause(numberMillis) {
var now = new Date();
var exitTime = now.getTime() + numberMillis;
while (true) {
now = new Date();
if (now.getTime() > exitTime)
return;
}
}
2008年6月26日 星期四
[Javascript]pause, wait, sleep 函數function
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言