diff options
author | Michaƫl Zasso <targos@protonmail.com> | 2021-05-23 12:28:18 +0300 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2021-05-25 23:36:47 +0300 |
commit | 2a1dea8a22b18ad1c4af6ec4ff87baf76f1d2576 (patch) | |
tree | 380b6e288992adfd7b210deadcbd4c63dc3de2f0 /benchmark | |
parent | a43a140ef54e5de7935093a39bd0b3e62bb8c4a0 (diff) |
benchmark: output JSON-compatible numbers
This is to simplify the implementation of a JavaScript version of the
compare.R script.
PR-URL: https://github.com/nodejs/node/pull/38778
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Diffstat (limited to 'benchmark')
-rw-r--r-- | benchmark/common.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/benchmark/common.js b/benchmark/common.js index 3f7abf73632..28a317b9a1d 100644 --- a/benchmark/common.js +++ b/benchmark/common.js @@ -267,7 +267,7 @@ class Benchmark { function nanoSecondsToString(bigint) { const str = bigint.toString(); const decimalPointIndex = str.length - 9; - if (decimalPointIndex < 0) { + if (decimalPointIndex <= 0) { return `0.${'0'.repeat(-decimalPointIndex)}${str}`; } return `${str.slice(0, decimalPointIndex)}.${str.slice(decimalPointIndex)}`; |