Skip to content

Commit 17abec4

Browse files
RafaelGSSmarco-ippolito
authored andcommitted
benchmark: add nodeTiming.uvmetricsinfo bench
PR-URL: #55614 Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
1 parent 6f47f53 commit 17abec4

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
'use strict';
2+
3+
constcommon=require('../common.js');
4+
constassert=require('node:assert');
5+
constfs=require('node:fs/promises');
6+
7+
const{
8+
performance,
9+
}=require('perf_hooks');
10+
11+
constbench=common.createBenchmark(main,{
12+
n: [1e6],
13+
events: [1,1000,10000],
14+
});
15+
16+
asyncfunctionrunEvents(events){
17+
for(leti=0;i<events;++i){
18+
assert.ok(awaitfs.statfs(__filename));
19+
}
20+
}
21+
22+
asyncfunctionmain({ n, events }){
23+
awaitrunEvents(events);
24+
bench.start();
25+
for(leti=0;i<n;i++){
26+
assert.ok(performance.nodeTiming.uvMetricsInfo);
27+
}
28+
bench.end(n);
29+
}

0 commit comments

Comments
 (0)