7cb4e54f500283d5c5da6e69b743f5b851ba344e
1 async
function runPoolifierTest (pool
, { tasks
, workerData
}) {
2 return new Promise((resolve
, reject
) => {
4 for (let i
= 1; i
<= tasks
; i
++) {
9 if (executions
=== tasks
) {
10 return resolve('FINISH')
22 function jsonIntegerSerialization (n
) {
23 for (let i
= 0; i
< n
; i
++) {
31 function generateRandomInteger (max
, min
= 0) {
35 return Math
.floor(Math
.random() * (max
- min
+ 1)) + min
37 return Math
.floor(Math
.random() * (max
+ 1))
41 * Intentionally inefficient implementation.
43 * @param {number} n - The number of fibonacci numbers to generate.
44 * @returns {number} - The nth fibonacci number.
46 function fibonacci (n
) {
48 return fibonacci(n
- 1) + fibonacci(n
- 2)
52 * Intentionally inefficient implementation.
54 * @param {number} n - The number to calculate the factorial of.
55 * @returns {number} - The factorial of n.
57 function factorial (n
) {
61 return factorial(n
- 1) * n
65 const LIST_FORMATTER
= new Intl
.ListFormat('en-US', {
72 jsonIntegerSerialization
,
73 generateRandomInteger
,