X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=benchmarks%2Fversus-external-pools%2Ffunctions%2Ffunction-to-bench.js;h=6a05cb629ad7bdcc816d393215bb6ae5d80a48d5;hb=589f0f1c052a4f0666cb8297e4d4a4f17a680a60;hp=b95f560f0807d7e9b3a638fe2106f609b5f368ca;hpb=008bd9b37fb9f62ddc53c5ad8f9ba5c9443d53c1;p=poolifier.git diff --git a/benchmarks/versus-external-pools/functions/function-to-bench.js b/benchmarks/versus-external-pools/functions/function-to-bench.js index b95f560f..6a05cb62 100644 --- a/benchmarks/versus-external-pools/functions/function-to-bench.js +++ b/benchmarks/versus-external-pools/functions/function-to-bench.js @@ -1,10 +1,11 @@ +'use strict' /** * The worker function to execute during pools benchmarks. * NOTE: This function requires to be self-contained, thread-safe and re-entrant. * @param {*} data The worker data. * @returns {*} The result. */ -function functionToBench (data) { +module.exports = function functionToBench (data) { const crypto = require('crypto') const fs = require('fs') const TaskTypes = { @@ -47,5 +48,3 @@ function functionToBench (data) { throw new Error(`Unknown task type: ${data.taskType}`) } } - -module.exports = functionToBench