repositories
/
poolifier.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
c530257301783ae5c550ad68e8b9a7bcb6c9d3c6
[poolifier.git]
/
benchmarks
/
external
/
workerpoolWorker.js
1
const
workerpool
=
require
(
'workerpool'
)
2
3
function
yourFunction
(
data
) {
4
for
(
let
i
=
0
;
i
<=
1000
;
i
++) {
5
const
o
= {
6
a
:
i
7
}
8
JSON
.
stringify
(
o
)
9
}
10
// console.log('This is the main thread ' + isMainThread)
11
return
{
ok
:
1
}
12
}
13
14
workerpool
.
worker
({
15
yourFunction
:
yourFunction
16
})