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 <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Mary Marchini <oss@mmarchini.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
  • Loading branch information
yashLadha authored and rickyes committed Aug 13, 2020
1 parent 7a1220a commit 56b25e7
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 56b25e7

Please sign in to comment.