stopwatch && $this->has('stopwatch')) { $this->stopwatch = parent::get('stopwatch'); $this->stopwatch->openSection(); $this->hasStopwatch = TRUE; } if ('stopwatch' === $id) { return $this->stopwatch; } Timer::start($id); if ($this->hasStopwatch) { $e = $this->stopwatch->start($id, 'service'); } $service = parent::get($id, $invalidBehavior); $this->tracedData[$id] = Timer::stop($id); if ($this->hasStopwatch && $e->isStarted()) { $e->stop(); } return $service; } /** * @return array */ public function getTracedData() { return $this->tracedData; } }