| Total Complexity | 2 |
| Total Lines | 14 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | final readonly class Timer implements \Stringable { |
||
|
|
|||
| 11 | private float $start; |
||
| 12 | |||
| 13 | public function __construct() { |
||
| 14 | $this->start = microtime(true); |
||
| 15 | } |
||
| 16 | |||
| 17 | public function __toString(): string { |
||
| 18 | $time = microtime(true) - $this->start; |
||
| 19 | |||
| 20 | return \sprintf('%.3F', $time); |
||
| 21 | } |
||
| 22 | } |
||
| 23 |