- <script type="text/javascript">
- function sleep(seconds) {
- this.date = Math.round(new Date().getTime()/1000);
- while(1) {
- if(Math.round(new Date().getTime()/1000) - this.date >= seconds) break;
- }
- return true;
- }
- sleep(5);
- alert(1);
- </script>
- //该片段来自于http://www.codesnippet.cn/detail/040920135615.html
来源: http://www.codesnippet.cn/detail/040920135615.html