• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2
3const common = require('../common.js');
4const v8 = require('v8');
5
6const bench = common.createBenchmark(main, {
7  method: [
8    'getHeapStatistics',
9    'getHeapSpaceStatistics',
10  ],
11  n: [1e6]
12});
13
14function main({ method, n }) {
15  bench.start();
16  for (let i = 0; i < n; i++)
17    v8[method]();
18  bench.end(n);
19}
20