Debian Codegraph @

fast-glob/src/benchmark/suites/product/async/fast-glob.ts

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