根据这里的Node js文档,我正在尝试测量我的应用程序的事件循环延迟。按照文档中的以下代码:
const { monitorEventLoopDelay } = require('perf_hooks');
const h = monitorEventLoopDelay({ resolution: 20 });
h.enable();
// ....
console.log(h.percentiles);
输出为:
Map {
0 => 1202176,
50 => 2260992,
75 => 2318336,
87.5 => 2334720,
93.75 => 2342912,
96.875 => 2347008,
98.4375 => 2351104,
99.21875 => 2377728,
99.609375 => 2670592,
99.8046875 => 3000320,
99.90234375 => 6770688,
99.951171875 => 6942720,
99.9755859375 => 27770880,
100 => 27770880
}
- 百分位数中使用的大小是多少?**我可以用毫秒计算吗?
1条答案
按热度按时间von4xj4u1#
Solution moved来自@RafaelPáezBastida的提问帖。
在文档中找到答案: