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