This is my example code
const _performance = require('perf_hooks').performance;
someFunction= ()=>{
_performance.mark('mark A')
// Do something
const a= Array(100000)
var boo =true;
a.forEach(el=>{
boo = ! boo
})
_performance.mark('mark B')
_performance.measure('total','mark B','mark A');
var measurments = _performance.getEntriesByType('measure');
measurments.forEach(measurment =>{
console.log(measurment.name + ' ' + measurment.duration)
} )
}
someFunction();
It crashes with the error message
TypeError: _performance.getEntriesByType is not a function
Any idea why is this happening? I am using node v10.7.0 on windows 10