build: update volta pnpm version
[benchmarks-js.git] / max.js
diff --git a/max.js b/max.js
index 74f6f43f0be9c03fb87d49bf62c1d662c3467e27..5a486473e9d6fa3afa4aa7da9347ce6384a28e49 100644 (file)
--- 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)
+})