Problem Statement
How can you measure the duration of async operations in Node.js?
Explanation
You can use console.time/console.timeEnd or performance.now() to measure how long async operations take. These tools help track performance bottlenecks in APIs or I/O-heavy code.
Code Solution
SolutionRead Only
console.time('fetch');
await fetch('https://api.com');
console.timeEnd('fetch');