Debian Codegraph @

fast-glob/src/benchmark/suites/product/async/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 glob(process.env.BENCHMARK_PATTERN as string, options, (error, matches) => {
17 if (error !== null) {
18 process.exit(0);
19 }
20
21 const memory = utils.getMemory();
22 const time = utils.timeEnd(timeStart);
23 const measures = utils.formatMeasures(matches.length, time, memory);
24
25 console.info(measures);
26 });