Bump @typescript-eslint/eslint-plugin from 5.38.1 to 5.39.0 (#573)
[poolifier.git] / benchmarks / internal / benchmark-utils.js
index 878c2cae4b34bcd77e8c24cc96c96b109c290c43..a915a044211fa7c8c14f98c369e82c30739c1733 100644 (file)
@@ -17,10 +17,12 @@ async function runPoolifierTest (pool, { tasks, workerData }) {
 }
 
 function generateRandomInteger (max, min = 0) {
+  max = Math.floor(max)
   if (min) {
-    return Math.floor(Math.random() * (max - min + 1) + min)
+    min = Math.ceil(min)
+    return Math.floor(Math.random() * (max - min + 1)) + min
   }
-  return Math.floor(Math.random() * max + 1)
+  return Math.floor(Math.random() * (max + 1))
 }
 
 const LIST_FORMATTER = new Intl.ListFormat('en-US', {