mirror of
https://github.com/nocobase/nocobase
synced 2024-11-16 11:36:54 +00:00
8 lines
282 B
TypeScript
8 lines
282 B
TypeScript
|
export async function measureExecutionTime(operation, operationName) {
|
||
|
const startTime = Date.now();
|
||
|
await operation();
|
||
|
const endTime = Date.now();
|
||
|
const duration = (endTime - startTime).toFixed(0);
|
||
|
console.log(`${operationName} completed in ${duration} milliseconds`);
|
||
|
}
|