JavaScript实现异步sleep函数 // 使用setTimeout实现异步sleep函数, 固定结构,无需更改 const sleep = (timeout) => { return new Promise((resolve)=>{ setTimeout((