async function test() { console.log('start timer'); await new Promise(resolve => setTimeout(resolve, 1000)); console.log('after 1 second'); } test();