rsnext/bench/readdir/glob.js
Joe Haddad 18a9c7e371
Improve linting rules to catch more errors (#9374)
* Update `packages/`

* Update examples

* Update tests

* Update bench

* Update top level files

* Fix build

* trigger
2019-11-10 19:24:53 -08:00

23 lines
527 B
JavaScript

const { join } = require('path')
const { promisify } = require('util')
const globMod = require('glob')
const glob = promisify(globMod)
const resolveDataDir = join(__dirname, 'fixtures', '**/*')
async function test() {
const time = process.hrtime()
await glob(resolveDataDir)
const hrtime = process.hrtime(time)
const nanoseconds = hrtime[0] * 1e9 + hrtime[1]
const milliseconds = nanoseconds / 1e6
console.log(milliseconds)
}
async function run() {
for (let i = 0; i < 50; i++) {
await test()
}
}
run()