public function getDuration() { if (!$this->isFinished()) { throw new \LogicException('Cannot compute duration: run is not finished.'); } return $this->finishedAt->diff($this->startedAt); }