js - 让浏览器sleep 2018-07-21 13:45 访问量: 1909 非常的不优雅 function sleep(d){for(var t = Date.now();Date.now() - t <= d;);} sleep(5000); //当前方法暂停5秒