Debian Codegraph @

fast-glob/src/benchmark/suites/product/sync/node-glob.ts

raw
1 import * as path from 'path';
2
3 import * as glob from 'glob';
4
5 import * as utils from '../../../utils';
6
7 const options: glob.IOptions = {
8 cwd: path.join(process.cwd(), process.env.BENCHMARK_BASE_DIR as string),
9 nosort: true,
10 nounique: true,
11 nodir: true
12 };
13
14 const timeStart = utils.timeStart();
15
16 try {
17 const matches = glob.sync(process.env.BENCHMARK_PATTERN as string, options);
18 const memory = utils.getMemory();
19 const time = utils.timeEnd(timeStart);
20 const measures = utils.formatMeasures(matches.length, time, memory);
21
22 console.info(measures);
23 } catch {
24 process.exit(0);
25 }