1.模拟睡眠的实现: function sleep(d){ for(var t = Date.now();Date.now() - t <= d;); } sleep(5000); 转载于:https://www.cnblogs.com/sening/p/5403842.html