Debian Codegraph @

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

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