| Total Complexity | 4 |
| Total Lines | 22 |
| Duplicated Lines | 0 % |
| Changes | 5 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | trait TracksExecutionTime |
||
| 11 | { |
||
| 12 | protected float $timeStart; |
||
| 13 | |||
| 14 | protected function startClock(): void |
||
| 15 | { |
||
| 16 | $this->timeStart = microtime(true); |
||
| 17 | } |
||
| 18 | |||
| 19 | protected function stopClock(): float |
||
| 20 | { |
||
| 21 | return microtime(true) - $this->timeStart; |
||
| 22 | } |
||
| 23 | |||
| 24 | protected function getExecutionTimeInMs(): int|float |
||
| 25 | { |
||
| 26 | return $this->stopClock() * 1000; |
||
| 27 | } |
||
| 28 | |||
| 29 | protected function getExecutionTimeString(): string |
||
| 32 | } |
||
| 33 | } |
||
| 34 |