title: Nodejs Performance measurement
body: <p>According to Node js documentation <a href="https://nodejs.org/api/perf_hooks.html#perf_hooks_perf_hooks_monitoreventloopdelay_options" rel="nofollow noreferrer">here</a>, I am trying to measure the event loop lag of my application. Following this code in the documentation:</p>
  <pre><code>const { monitorEventLoopDelay } = require('perf_hooks');
  const h = monitorEventLoopDelay({ resolution: 20 });
  h.enable();
  // ....
  console.log(h.percentiles);
  </code></pre>
  <p>Output is:</p>
  <pre><code>Map {
  0 =&gt; 1202176,
  50 =&gt; 2260992,
  75 =&gt; 2318336,
  87.5 =&gt; 2334720,
  93.75 =&gt; 2342912,
  96.875 =&gt; 2347008,
  98.4375 =&gt; 2351104,
  99.21875 =&gt; 2377728,
  99.609375 =&gt; 2670592,
  99.8046875 =&gt; 3000320,
  99.90234375 =&gt; 6770688,
  99.951171875 =&gt; 6942720,
  99.9755859375 =&gt; 27770880,
  100 =&gt; 27770880
  </code></pre>
  <p>}</p>
  <p><strong>What is the magnitude used in the percentiles?</strong> Can I get it in milliseconds?</p>
  <p><strong>EDIT</strong>: Found the answer in documentation:
  <em>The delays will be reported in nanoseconds.</em></p>