cal.pub0.org/packages/lib/perf.ts

9 lines
200 B
TypeScript

export const logP = (message: string) => {
const start = performance.now();
return () => {
const end = performance.now();
console.log(`[PERF]: ${message} took ${end - start}ms`);
};
};