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.
12 lines
315 B
12 lines
315 B
import * as 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);
|
|
}
|
|
}
|