8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 317a13b commit 4d4a833Copy full SHA for 4d4a833
benchmark/fs/bench-cpSync.js
@@ -0,0 +1,23 @@
1
+'use strict';
2
+
3
+const common = require('../common');
4
+const fs = require('fs');
5
+const path = require('path');
6
+const tmpdir = require('../../test/common/tmpdir');
7
+tmpdir.refresh();
8
9
+const bench = common.createBenchmark(main, {
10
+ n: [1, 100, 10_000],
11
+});
12
13
+function main({ n }) {
14
+ tmpdir.refresh();
15
+ const options = { force: true, recursive: true };
16
+ const src = path.join(__dirname, '../../test/fixtures/copy');
17
+ const dest = tmpdir.resolve(`${process.pid}/subdir/cp-bench-${process.pid}`);
18
+ bench.start();
19
+ for (let i = 0; i < n; i++) {
20
+ fs.cpSync(src, dest, options);
21
+ }
22
+ bench.end(n);
23
+}
0 commit comments