By Guest

Unnamed Paste

Auto Detect 321 Bytes 51 3 months ago
async function sleep(time) { console.log(`Waiting for ${time}ms.`) let promise = new Promise((resolve, reject) => { setTimeout(() => resolve("Done!"), time) }); return await promise; } async function main() { console.log("Hello, world!") sleep(1000); console.log("Finished.") } main();