+'use strict'
/**
- * The worker function to execute during pools benchmarks.
- * NOTE: This function requires to be self-contained, thread-safe and re-entrant.
+ * The task function to execute during pools benchmarks.
+ * NOTE: This function requires to be self-contained, thread-safe and re-entrant (node-worker-threads-pool requirement).
* @param {*} data The worker data.
* @returns {*} The result.
*/
-module.exports = function functionToBench (data) {
+const functionToBench = (data) => {
const crypto = require('crypto')
const fs = require('fs')
const TaskTypes = {
throw new Error(`Unknown task type: ${data.taskType}`)
}
}
+
+module.exports = functionToBench