public function getDurationInSeconds() { if (!$this->isFinished()) { throw new \LogicException('Cannot return duration: unit not finished.'); } return $this->finishedAt->getTimestamp() - $this->startedAt->getTimestamp(); }