| Total Complexity | 7 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Coverage | 75% |
| Changes | 3 | ||
| Bugs | 1 | Features | 2 |
| 1 | <?php |
||
| 16 | final class Stopwatch |
||
| 17 | { |
||
| 18 | private static ?TimingCollector $collector = null; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @psalm-suppress UnusedConstructor |
||
| 22 | */ |
||
| 23 | private function __construct() |
||
| 24 | { |
||
| 25 | // static class |
||
| 26 | } |
||
| 27 | |||
| 28 | 28 | public static function init(TimingCollector $collector): void |
|
| 29 | { |
||
| 30 | 28 | self::$collector = $collector; |
|
| 31 | } |
||
| 32 | |||
| 33 | 23 | public static function start(string $name): void |
|
| 41 | } |
||
| 42 | |||
| 43 | 17 | public static function stop(string $name, bool $force = false): void |
|
| 52 |