Skip to content

Commit

Permalink
benchmark: add benchmark script for resourceUsage
Browse files Browse the repository at this point in the history
Added a benchmark script for process method to benchmark the method
resourceUsage.

PR-URL: #34691
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Mary Marchini <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ricky Zhou <[email protected]>
  • Loading branch information
yashLadha authored and addaleax committed Sep 22, 2020
1 parent 5e7aa03 commit c709010
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions benchmark/process/resourceUsage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use strict';

const common = require('../common.js');
const bench = common.createBenchmark(main, {
n: [1e5]
});

function main({ n }) {
bench.start();
for (let i = 0; i < n; i++) {
process.resourceUsage();
}
bench.end(n);
}

0 comments on commit c709010

Please sign in to comment.