2 const { isMainThread
} = require('worker_threads')
3 const { ThreadWorker
} = require('../../../lib/index')
4 const { jsonIntegerSerialization
} = require('../benchmark-utils')
8 function yourFunction (data
) {
9 jsonIntegerSerialization(1000)
10 debug
=== true && console
.debug('This is the main thread ' + isMainThread
)
14 module
.exports
= new ThreadWorker(yourFunction
)