每隔几秒输出值
function sleep(interval) {return new Promise(resolve => {setTimeout(resolve, interval);})}// 用法async function one2FiveInAsync() {for(let i = 1; i <= 5; i++) {console.log(i);await sleep(1000*i);}}one2FiveInAsync();
https://www.jianshu.com/p/1c9e9c161612