function sleep (time) { return new Promise((resolve) => setTimeout(resolve, time)); } async function main(){ await sleep(1000); console.log(1) await sleep(1000); console.log(2) await sleep(1000); console.log(3) } main();
function sleep (time) { return new Promise((resolve) => setTimeout(resolve, time)); } async function main(){ await sleep(1000); console.log(1) await sleep(1000); console.log(2) await sleep(1000); console.log(3) } main();