Skip to content

Commit f23bee8

Browse files
committed
Fix type conversion: Bigint/Number
1 parent ae6ce7c commit f23bee8

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

JavaScript/2-benchmark.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,10 @@ benchmark.do = (count, tests) => {
7171
return { name, time: diff };
7272
});
7373
console.log();
74-
const top = times.sort((t1, t2) => (t1.time - t2.time));
74+
console.log(times);
75+
const top = times.sort((t1, t2) => t1.time > t2.time ? 1 : -1);
7576
const best = top[0].time;
76-
top.forEach(test => {
77+
times.forEach(test => {
7778
test.percent = relativePercent(best, test.time);
7879
const time = lpad(test.time.toString(), '.', 10);
7980
const percent = test.percent === 0 ? 'min' : test.percent + '%';

0 commit comments

Comments
 (0)