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.
gristlabs_grist-core/app/server/lib/reportTimeTaken.ts

12 lines
310 B

import log from 'app/server/lib/log';
export function reportTimeTaken<T>(locationLabel: string, callback: () => T): T {
const start = Date.now();
try {
return callback();
} finally {
const timeTaken = Date.now() - start;
log.debug("Time taken in %s: %s ms", locationLabel, timeTaken);
}
}