I'm encountering a problem with the error
ReferenceError: performance is not defined
while attempting to use performance.now() for measuring the execution time of a function call:
export async function find(someId: string, ctx: context.IContext) {
try {
var t0 = performance.now();
var res = someModel.find(someId, ctx.cookies);
var t1 = performance.now();
console.log("Call to find took " + (t1 - t0) + " milliseconds.");
return res;
} catch (err) {
console.error(err);
throw err;
}
}
Can anyone provide suggestions on how I could resolve this issue?