File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -5,18 +5,18 @@ const timeDiff = (start: number, end: number) =>
55 ms ( end - start , { long : true } ) ;
66
77export interface TimeTracker {
8- run < T > ( name : string , fn : ( ) => T ) : T ;
8+ run < T > ( name : string , fn : ( ) => Promise < T > ) : Promise < T > ;
99}
1010
1111export const createTimeTracker = ( options : {
1212 outputChannel : LogOutputChannel ;
1313} ) : TimeTracker => {
1414 return {
15- run < T > ( name : string , fn : ( ) => T ) : T {
15+ async run < T > ( name : string , fn : ( ) => Promise < T > ) : Promise < T > {
1616 options . outputChannel . trace ( `[${ name } ]: Starting...` ) ;
1717 const start = Date . now ( ) ;
1818 try {
19- const result = fn ( ) ;
19+ const result = await fn ( ) ;
2020 const end = Date . now ( ) ;
2121 options . outputChannel . trace (
2222 `[${ name } ]: completed in ${ timeDiff ( start , end ) } ` ,
You can’t perform that action at this time.
0 commit comments