<?php

declare(strict_types=1);

namespace App\Framework\Performance;

readonly class PerformanceMarker
{
    public float $time;
    public int $memory;

    public function __construct(
        public string              $label,
        public PerformanceCategory $category,
    ) {
        $this->time = microtime(true);
        $this->memory = memory_get_usage();
    }

    public function getLabel(): string
    {
        return $this->label;
    }

    public function getCategory(): PerformanceCategory
    {
        return $this->category;
    }

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

    public function getMemory(): int
    {
        return $this->memory;
    }
}
