Difficulty: 3/10Date API, Timers, High‑resolution time1setTimeout(callback, delay)2clearTimeout(timeoutId)3setInterval(callback, interval)4clearInterval(intervalId)5setImmediate(callback)Scenario Questions0-2 years experience1How would you get the current timestamp in milliseconds since the epoch inside a Node.js service?2If you need to run a function exactly five seconds from now, which built‑in timer would you use and how would you cancel it if needed?3What does Date.now() return and how does it differ from creating a new Date object?Follow-up QuestionsHow would you mock or stub these functions in unit tests?What are the risks of using a wall‑clock timer for measuring elapsed time?Can you give an example where you’d prefer process.hrtime over Date.now?Suggest Improvement