JavaScript 小代码 1.模拟睡眠的实现: function sleep(d){ for(var t = Date.now();Date.now() - t <= d;); } sleep(5000);