Javascript – how JS program knows the time in setTimeout inside a function?
const p1 = new Promise((resolve,reject) => { setTimeout(()=>{ resolve("xxx"); }, 5000) }); const p2 = new Promise((resolve,reject) => { setTimeout(()=>{ resolve("xx"); }, 10000) }); async function he() { console.log("start"); const s1 = await p1; console.log("Rome"); const s2 = await p2;…