<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\DI\Performance;

final class PerformanceTimer
{
    private float $start = 0.0;
    private float $end = 0.0;

    public function start(): void { $this->start = microtime(true); }
    public function stop(): void { $this->end = microtime(true); }

    public function milliseconds(): float
    {
        return round(($this->end - $this->start) * 1000, 3);
    }
}
