Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 34483a2

Browse filesBrowse files
committed
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 cfa4d96 commit 34483a2
Copy full SHA for 34483a2

File tree

Expand file treeCollapse file tree

1 file changed

+29
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.