0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-27 22:16:50 +01:00
nodejs/benchmark/path/normalize-win32.js

24 lines
404 B
JavaScript
Raw Normal View History

'use strict';
const common = require('../common.js');
const { win32 } = require('path');
const bench = common.createBenchmark(main, {
path: [
'',
'.',
'C:\\..\\',
'C:\\foo',
'C:\\foo\\bar',
'C:\\foo\\bar\\\\baz\\asdf\\quux\\..',
],
n: [1e6]
});
function main({ n, path }) {
bench.start();
for (var i = 0; i < n; i++) {
win32.normalize(path);
}
bench.end(n);
}