diff --git a/src/Events/Hook_Events_Provider.php b/src/Events/Hook_Events_Provider.php index c8bd851..d25f59e 100644 --- a/src/Events/Hook_Events_Provider.php +++ b/src/Events/Hook_Events_Provider.php @@ -101,6 +101,10 @@ class Hook_Events_Provider implements ServiceProviderInterface, Bootable_Provide public function get_events() { + if ( $this->stopwatch->isStarted( 'Toolbar' ) ) { + $this->stopwatch->stop( 'Toolbar' ); + } + $events = $this->stopwatch->getSectionEvents( '__root__' ); return array_map( [ $this, 'transform' ], array_keys( $events ), $events ); diff --git a/src/Laps.php b/src/Laps.php index 4ae35d2..7a75754 100644 --- a/src/Laps.php +++ b/src/Laps.php @@ -131,13 +131,6 @@ class Laps extends Container { global $timestart; - /** @var Stopwatch $stopwatch */ - $stopwatch = $this['stopwatch']; - - if ( $stopwatch->isStarted( 'Toolbar' ) ) { - $stopwatch->stop( 'Toolbar' ); - } - $events = []; foreach ( $this->providers as $provider ) {