c922c6a3f4
## Feature - [ ] Telemetry added. In case of a feature if it's used or not. ### Replace 'require' with 'import' in bench files Node.js 12 allows you to use `import`. ### Update dependancies https://github.com/jprichardson/node-fs-extra/blob/master/CHANGELOG.md#breaking-changes > Require Node.js v12+ For #25761, Node.js 12 is required. Therefore, there is no problem updating it. For benchmarking purposes, it would be reasonable to update to the latest version.
21 lines
500 B
JavaScript
21 lines
500 B
JavaScript
import { join } from 'path'
|
|
import { recursiveReadDir } from 'next/dist/lib/recursive-readdir'
|
|
const resolveDataDir = join(__dirname, 'fixtures')
|
|
|
|
async function test() {
|
|
const time = process.hrtime()
|
|
await recursiveReadDir(resolveDataDir, /\.js$/)
|
|
|
|
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()
|