Javascript的sleep函数转载自知乎function sleep(delay) { var start = new Date().getTime(); while (new Date().getTime() < start + delay); }