X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=max.js;h=5a486473e9d6fa3afa4aa7da9347ce6384a28e49;hb=52d07fb863422041a24874efb893c711bf0b9cd4;hp=74f6f43f0be9c03fb87d49bf62c1d662c3467e27;hpb=47006ddf6055b02dd084ae91269f12b44ce8225d;p=benchmarks-js.git diff --git a/max.js b/max.js index 74f6f43..5a48647 100644 --- a/max.js +++ b/max.js @@ -1,7 +1,8 @@ const Benchmark = require('benny') const { generateRandomNumberArray } = require('./benchmark-utils') -const testArray = generateRandomNumberArray(10000) +const size = 10000 +const testArray = generateRandomNumberArray(size) /** * @@ -44,7 +45,7 @@ function sortMax (values) { } Benchmark.suite( - 'max', + `Max from ${size} numbers`, Benchmark.add('Math.max', () => { Math.max(...testArray) }), @@ -65,4 +66,6 @@ Benchmark.suite( Benchmark.save({ file: 'max', format: 'json', details: true }), Benchmark.save({ file: 'max', format: 'chart.html', details: true }), Benchmark.save({ file: 'max', format: 'table.html', details: true }) -) +).catch(err => { + console.error(err) +})