In Node.js it's easy now.
console.time('perf-label')
bigData.map( (item) => { /* do some heavy lifting */ } )
console.timeEnd('perf-label') // perf-label: 25333.627ms
console.time() uses process.hrtime in the background now. hrtime is the Node.js version of browsers performance.now function.
You can also run nested measurements.
console.time('entire-thing')
bigData.map( (item) => {
console.time('each-item')
/* do some heavy lifting */
console.timeEnd('each-item') // each-item: 101.927ms // each-item: 99.102ms // ... ...
} )
console.timeEnd('entire-thing') // entire-thing: 27456.221ms
Add those measurements to your tests to stop worrying where to do the measurements. If your test framework expects a boolean value, return true will do or it expects an assertion assert(1,1) is just fine. I can't recommend mixing real tests with performance measurements because the assertion will hurt the performance values and mocking may trick you too.