repositories
/
poolifier.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
48a0fc78c8851f6c31c3e87d7d7d35eb3b6e0dc2
[poolifier.git]
/
function-to-bench.js
1
module
.
exports
=
function
(
data
) {
2
if
(
data
.
taskType
===
'CPU_INTENSIVE'
) {
3
// CPU intensive task
4
for
(
let
i
=
0
;
i
<=
5000
;
i
++) {
5
const
o
= {
6
a
:
i
7
}
8
JSON
.
stringify
(
o
)
9
}
10
return
{
ok
:
1
}
11
}
else
{
12
throw new
Error
(
'Please specify the task type'
)
13
}
14
}