File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -443,6 +443,7 @@ export class Task extends EventTarget {
443443 // eslint-disable-next-line no-useless-call
444444 const fnResult = await this . #fn. call ( this )
445445 let taskTime = this . #bench. opts . now ( ) - taskStart
446+
446447 const overriddenDuration = getOverriddenDurationFromFnResult ( fnResult )
447448 if ( overriddenDuration !== undefined ) {
448449 taskTime = overriddenDuration
@@ -454,11 +455,12 @@ export class Task extends EventTarget {
454455 const taskStart = this . #bench. opts . now ( )
455456 // eslint-disable-next-line no-useless-call
456457 const fnResult = this . #fn. call ( this )
458+ let taskTime = this . #bench. opts . now ( ) - taskStart
459+
457460 invariant (
458461 ! isPromiseLike ( fnResult ) ,
459462 'task function must be sync when using `runSync()`'
460463 )
461- let taskTime = this . #bench. opts . now ( ) - taskStart
462464 const overriddenDuration = getOverriddenDurationFromFnResult ( fnResult )
463465 if ( overriddenDuration !== undefined ) {
464466 taskTime = overriddenDuration
You can’t perform that action at this time.
0 commit comments