mirror of
https://github.com/spacebarchat/server.git
synced 2026-10-23 00:03:05 +00:00
Merge branch 'master' into feat/forwards
This commit is contained in:
3 files changed
+108
-65
No files matched your search
@@ -61,3 +61,10 @@ export async function timePromise<T>(fn: () => Promise<T>): Promise<{ result: T;
|
||||
const elapsed = stopwatch.elapsed();
|
||||
return { result, elapsed };
|
||||
}
|
||||
|
||||
export function timeFunction<T>(fn: () => T): { result: T; elapsed: ElapsedTime } {
|
||||
const stopwatch = Stopwatch.startNew();
|
||||
const result = fn();
|
||||
const elapsed = stopwatch.elapsed();
|
||||
return { result, elapsed };
|
||||
}
|
||||
Reference in new issue
Block a user