end = $time; } public function getStart(): float { return $this->start; } public function getId(): string { return $this->id; } public function getDescription(): string { return $this->description; } public function getEnd(): float { return $this->end ?? -1; } public function getDuration(): float { if (!$this->end) { $this->end = microtime(true); } return $this->end - $this->start; } public function __toString(): string { return $this->getId() . ' ' . $this->getDescription() . ' ' . $this->getDuration(); } }