You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

21 lines
455 B

import { Injectable, Logger } from '@nestjs/common';
@Injectable()
export class PerformanceLoggingService {
public logPerformance({
className,
methodName,
startTime
}: {
className: string;
methodName: string;
startTime: number;
}) {
const endTime = performance.now();
Logger.debug(
`Completed execution of ${methodName}() in ${((endTime - startTime) / 1000).toFixed(3)} seconds`,
className
);
}
}