async function test(){ let d = new Date(); console.log(d); await new Promise((fullfil)=>{setTimeout(fullfil, 1000);}); let dd = new Date(); console.log(dd, (dd-d)); } test(); /* Fri Aug 04 2023 09:51:18 GMT+0900 (한국 표준시) Promise {<pending>} Fri Aug 04 2023 09:51:19 GMT+0900 (한국 표준시) 1002 */