/
githubmirror
/
deno
Обзор
Документация
Войти
/
githubmirror
/
deno
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
tests/bench/stdio/stdio.js
19 строк
495 B
David Sherret
ci: add build, test, wpt, and bench jobs (#32158)
14 фев 2026, 14:31
Не верифицирован
14 фев 2026, 14:31
c15529e
Код
Авторство
О чём код?
// Copyright 2018-2026 the Deno authors. MIT license. // // From https://github.com/just-js/benchmarks/tree/main/01-stdio // deno-lint-ignore-file no-console const blocksize = parseInt(Deno.args[0] || 65536); const buf = new Uint8Array(blocksize); let size = 0; let reads = 0; let n = Deno.stdin.readSync(buf); while (n > 0) { reads++; size += n; n = Deno.stdin.readSync(buf); } if (n < 0) throw new Error("Bad Read"); console.log(`size ${size} reads ${reads} blocksize ${blocksize}`);