| 1 | <?php |
||
| 5 | class TimerPool |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @var Timer[] |
||
| 9 | */ |
||
| 10 | protected $timers = []; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @var string[] |
||
| 14 | */ |
||
| 15 | protected $markers = []; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var string |
||
| 19 | */ |
||
| 20 | private $format; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Create a new TimerPool instance. |
||
| 24 | * |
||
| 25 | * @param string $format |
||
| 26 | */ |
||
| 27 | 3 | public function __construct($format = 'H:i:s.ms') |
|
| 32 | |||
| 33 | /** |
||
| 34 | * Start timer with a specific marker. |
||
| 35 | * |
||
| 36 | * @param string $marker |
||
| 37 | */ |
||
| 38 | 3 | public function start($marker) |
|
| 42 | |||
| 43 | /** |
||
| 44 | * Stop timer with a specific marker. |
||
| 45 | * |
||
| 46 | * @param string $marker |
||
| 47 | */ |
||
| 48 | 3 | public function stop($marker) |
|
| 54 | |||
| 55 | /** |
||
| 56 | * Return sorted times. |
||
| 57 | * |
||
| 58 | * @return string[] |
||
| 59 | */ |
||
| 60 | 3 | public function build() |
|
| 68 | } |
||
| 69 |