From 6154188786108b253e8c775f728783e9ffa5293f Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Sat, 17 Sep 2022 15:34:43 +0530 Subject: perf(ext/console): avoid `wrapConsole` when not inspecting (#15931) --- cli/bench/console.js | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 cli/bench/console.js (limited to 'cli/bench') diff --git a/cli/bench/console.js b/cli/bench/console.js new file mode 100644 index 000000000..b1873953c --- /dev/null +++ b/cli/bench/console.js @@ -0,0 +1,8 @@ +// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. +const count = 100000; + +const start = Date.now(); +for (let i = 0; i < count; i++) console.log("Hello World"); +const elapsed = Date.now() - start; +const rate = Math.floor(count / (elapsed / 1000)); +console.log(`time ${elapsed} ms rate ${rate}`); -- cgit v1.2.3