📅  最后修改于: 2022-03-11 15:01:23.788000             🧑  作者: Mango
sleep = milliseconds => new Promise(resolve => setTimeout(resolve, milliseconds));
// V Must add this async keyword
sayHi = async () => {
// V Must include await
await sleep(1000); // Sleep 1000 milliseconds (1 second)
console.log('Hi');
// Rest of code...
}