mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
6b170f7c15
The original PR didn't update the benchmark after renaming the option. PR-URL: https://github.com/nodejs/node/pull/23699 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
24 lines
503 B
JavaScript
24 lines
503 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const fs = require('fs');
|
|
const tmpdir = require('../../test/common/tmpdir');
|
|
tmpdir.refresh();
|
|
let dirc = 0;
|
|
|
|
const bench = common.createBenchmark(main, {
|
|
n: [1e4],
|
|
});
|
|
|
|
function main({ n }) {
|
|
bench.start();
|
|
(function r(cntr) {
|
|
if (cntr-- <= 0)
|
|
return bench.end(n);
|
|
const pathname = `${tmpdir.path}/${++dirc}/${++dirc}/${++dirc}/${++dirc}`;
|
|
fs.mkdir(pathname, { recursive: true }, (err) => {
|
|
r(cntr);
|
|
});
|
|
}(n));
|
|
}
|