/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
benchmark/async_hooks/async-local-storage-run.js
21 строка
436 B
Antoine du Hamel
benchmark: add trailing commas in `benchmark/async_hooks`
02 фев 2023, 00:46
Не верифицирован
02 фев 2023, 00:46
997c47f
Код
Авторство
О чём код?
'use strict'; const common = require('../common.js'); const { AsyncLocalStorage } = require('async_hooks'); const bench = common.createBenchmark(main, { n: [1e7], }); async function run(store, n) { for (let i = 0; i < n; i++) { await new Promise((resolve) => store.run(i, resolve)); } } function main({ n }) { const store = new AsyncLocalStorage(); bench.start(); run(store, n).then(() => { bench.end(n); }); }