File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -44,19 +44,27 @@ function _isTest(t: any): t is Test {
4444 return t && typeof t === "object" && t . name && t . line !== undefined ;
4545}
4646
47+ const currentMicrosecond = ( ) => {
48+ const now = GLib . DateTime . new_now_local ( ) ;
49+ return now . to_unix ( ) * 1000000 + now . get_microsecond ( ) ;
50+ } ;
51+
4752class SuiteRunner {
4853 constructor (
4954 private readonly options : SuiteRunnerOptions ,
5055 private readonly tracker : ProgressTracker ,
5156 private readonly suiteID : symbol
5257 ) { }
5358
54- private async measureRun ( action : ( ) => void ) : Promise < number > {
55- const start = GLib . DateTime . new_now_local ( ) ! . get_microsecond ( ) ;
59+ private async measureRun (
60+ action : ( ) => void | Promise < void >
61+ ) : Promise < number > {
62+ const start = currentMicrosecond ( ) ;
5663 await action ( ) ;
57- const end = GLib . DateTime . new_now_local ( ) ! . get_microsecond ( ) ;
64+ const end = currentMicrosecond ( ) ;
5865
59- return end - start ;
66+ const duration = end - start ;
67+ return duration ;
6068 }
6169
6270 private testNameMatches ( unitName : string [ ] ) {
You can’t perform that action at this time.
0 commit comments