The best way to measure Node.js event loop cycle time

155 views Asked by At

How can I measure Node.js event loop cycle time? Question is not about event loop delay. Time of the first iteration, second, etc.

Thanks.

I've tried this, but don't know if this a true way...

const time = process.hrtime();

setTimeout(() => {
  const diff = process.hrtime(time);

  console.log('benchmark took %d nanoseconds', diff[0] * 1e9 + diff[1]);
});
0

There are 0 answers