We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ae6ce7c commit f23bee8Copy full SHA for f23bee8
1 file changed
JavaScript/2-benchmark.js
@@ -71,9 +71,10 @@ benchmark.do = (count, tests) => {
71
return { name, time: diff };
72
});
73
console.log();
74
- const top = times.sort((t1, t2) => (t1.time - t2.time));
+ console.log(times);
75
+ const top = times.sort((t1, t2) => t1.time > t2.time ? 1 : -1);
76
const best = top[0].time;
- top.forEach(test => {
77
+ times.forEach(test => {
78
test.percent = relativePercent(best, test.time);
79
const time = lpad(test.time.toString(), '.', 10);
80
const percent = test.percent === 0 ? 'min' : test.percent + '%';
0 commit comments