Bump @types/node from 18.7.19 to 18.7.22 (#563)
[poolifier.git] / benchmarks / internal / benchmark-utils.js
index 5579527ac6f99a0a30b0fe951bf5afa6ff531a77..a915a044211fa7c8c14f98c369e82c30739c1733 100644 (file)
@@ -17,7 +17,9 @@ async function runPoolifierTest (pool, { tasks, workerData }) {
 }
 
 function generateRandomInteger (max, min = 0) {
+  max = Math.floor(max)
   if (min) {
+    min = Math.ceil(min)
     return Math.floor(Math.random() * (max - min + 1)) + min
   }
   return Math.floor(Math.random() * (max + 1))