/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
benchmark/path/isAbsolute-posix.js
22 строки
388 B
Antoine du Hamel
benchmark: add trailing commas in `benchmark/path`
14 фев 2023, 20:09
Не верифицирован
14 фев 2023, 20:09
3acdeb1
Код
Авторство
О чём код?
'use strict'; const common = require('../common.js'); const { posix } = require('path'); const bench = common.createBenchmark(main, { path: [ '', '.', '/foo/bar', '/baz/..', 'bar/baz', ], n: [1e5], }); function main({ n, path }) { bench.start(); for (let i = 0; i < n; i++) { posix.isAbsolute(i % 3 === 0 ? `${path}${i}` : path); } bench.end(n); }