加载中...
/**
* @file 返回一个 Promise,并在 ms 毫秒后 Promise 变为完成状态
*/
export function sleep(ms: number): Promise<undefined> {
// 补全此处代码
throw new Error('功能待实现');
}
async function main(){
console.log('a')
await sleep(1000);
console.log('b');
await sleep(1000);
console.log('c');
}
main()
export default {}
答案已隐藏,点击"查看答案"按钮查看参考答案