diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2022-09-17 15:34:43 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-17 15:34:43 +0530 |
commit | 6154188786108b253e8c775f728783e9ffa5293f (patch) | |
tree | c39fd66203fe839d67dbd34309c5045abf1ce1ed /cli/bench/console.js | |
parent | e7934432ced9674d23d31a4b6973398bd8c8d090 (diff) |
perf(ext/console): avoid `wrapConsole` when not inspecting (#15931)
Diffstat (limited to 'cli/bench/console.js')
-rw-r--r-- | cli/bench/console.js | 8 |
1 files changed, 8 insertions, 0 deletions
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}`); |