epoch = $epoch instanceof \DateTime ? $epoch->getTimestamp() * 1000 : ($epoch ?? 0); if ($this->epoch < 0) { throw new \InvalidArgumentException('Epoch must be non-negative.'); } } public function value(): int { $now = (int) floor(microtime(as_float: true) * 1000); return $now - $this->epoch; } }