Promise 形式的等待,等待指定毫秒数后 resolve 空值。
毫秒数
0.0.7
(async () => { console.log(1); // 输出 1 await wait(350); // 等待 350 毫秒 console.log(2); // 输出 2})(); Copy
(async () => { console.log(1); // 输出 1 await wait(350); // 等待 350 毫秒 console.log(2); // 输出 2})();
Promise 形式的等待,等待指定毫秒数后 resolve 空值。