• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2const common = require('../common.js');
3const { win32 } = require('path');
4
5const bench = common.createBenchmark(main, {
6  path: [
7    '',
8    '.',
9    'C:\\..\\',
10    'C:\\foo',
11    'C:\\foo\\bar',
12    'C:\\foo\\bar\\\\baz\\asdf\\quux\\..',
13  ],
14  n: [1e5]
15});
16
17function main({ n, path }) {
18  bench.start();
19  for (let i = 0; i < n; i++) {
20    win32.normalize(i % 3 === 0 ? `${path}${i}` : path);
21  }
22  bench.end(n);
23}
24