1 | <?php |
||
17 | final class Timer |
||
18 | { |
||
19 | /** |
||
20 | * @var |
||
21 | */ |
||
22 | private $start; |
||
23 | |||
24 | /** |
||
25 | * Timer constructor. |
||
26 | * |
||
27 | * @param float $start |
||
28 | */ |
||
29 | 3 | private function __construct(float $start) |
|
33 | |||
34 | /** |
||
35 | * Starts the timer. |
||
36 | * |
||
37 | * @return Timer |
||
38 | */ |
||
39 | 3 | public static function start(): Timer |
|
43 | |||
44 | /** |
||
45 | * Returns the elapsed time in microseconds. |
||
46 | * |
||
47 | * @return float |
||
48 | */ |
||
49 | public function result(): float |
||
53 | } |
||
54 |