const timer = ms => new Promise(r => setTimeout(r, ms)); async function doSomething() { console.log("Start"); await timer(2000); console.log("Stop"); } doSomething();
Start Stop