<?php

namespace Planaday\Utility\Timer;

class Timestamp {
	/**
	 * @param string $name
	 * @param float $time
	 * @param null|Timestamp[] $subTimes
	 */
	public function __construct(
		public string $name,
		public float $time,
		public ?array $subTimes = null
	) {}

	public function getName(): string {
		return $this->name;
	}

	public function getTime(): float {
		return $this->time;
	}

	/**
	 * @return Timestamp[]|null
	 */
	public function getSubTimes(): ?array {
		return $this->subTimes;
	}
}