@@ -249,7 +249,7 @@ public function shouldSkipActions(?bool $shouldSkip = null): bool
249249 private function executeActions (array $ actions ): void
250250 {
251251 $ status = self ::HOOK_SUCCEEDED ;
252- $ start = microtime ( true );
252+ $ timer = Timer:: createAndStart ( );
253253 try {
254254 if ($ this ->config ->failOnFirstError ()) {
255255 $ this ->executeFailOnFirstError ($ actions );
@@ -262,8 +262,7 @@ private function executeActions(array $actions): void
262262 $ this ->dispatcher ->dispatch ('onHookFailure ' );
263263 throw $ e ;
264264 } finally {
265- $ duration = microtime (true ) - $ start ;
266- $ this ->printer ->hookEnded ($ status , $ this ->hookLog , $ duration );
265+ $ this ->printer ->hookEnded ($ status , $ this ->hookLog , $ timer ->stop ());
267266 }
268267 }
269268
@@ -319,6 +318,7 @@ private function handleAction(Config\Action $action): void
319318
320319 $ io = new IO \CollectorIO ($ this ->io );
321320 $ status = ActionLog::ACTION_SUCCEEDED ;
321+ $ timer = Timer::createAndStart ();
322322
323323 try {
324324 if (!$ this ->doConditionsApply ($ action ->getConditions (), $ io )) {
@@ -336,13 +336,13 @@ private function handleAction(Config\Action $action): void
336336
337337 $ runner = $ this ->createActionRunner (Util::getExecType ($ action ->getAction ()));
338338 $ runner ->execute ($ this ->config , $ io , $ this ->repository , $ action );
339- $ this ->printer ->actionSucceeded ($ action );
339+ $ this ->printer ->actionSucceeded ($ action, $ timer -> stop () );
340340 } catch (ActionNotApplicable $ e ) {
341341 $ this ->printer ->actionSkipped ($ action );
342342 return ;
343343 } catch (Exception $ e ) {
344344 $ status = ActionLog::ACTION_FAILED ;
345- $ this ->printer ->actionFailed ($ action );
345+ $ this ->printer ->actionFailed ($ action, $ timer -> stop () );
346346 if (!$ action ->isFailureAllowed ($ this ->config ->isFailureAllowed ())) {
347347 throw $ e ;
348348 }
0 commit comments