HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/eleo.komma.nl/vendor/phpbench/phpbench/lib/Assertion/Ast/TimeValue.php
<?php

namespace PhpBench\Assertion\Ast;

use PhpBench\Util\TimeUnit;

class TimeValue implements Value
{
    /**
     * @var float
     */
    private $value;
    /**
     * @var string
     */
    private $unit;

    public function __construct(float $value, ?string $unit = TimeUnit::MICROSECONDS)
    {
        $this->value = $value;
        $this->unit = $unit;
    }

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

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

    public static function fromMicroseconds(float $int): self
    {
        return new self($int, TimeUnit::MICROSECONDS);
    }
}