1 | <?php |
||
19 | class GenericTimer implements Timer { |
||
20 | |||
21 | /** |
||
22 | * Time last started. |
||
23 | * @var float |
||
24 | */ |
||
25 | protected $started; |
||
26 | |||
27 | /** |
||
28 | * Total elapsed time |
||
29 | * @var float |
||
30 | */ |
||
31 | protected $elapsed; |
||
32 | |||
33 | public function __construct() { |
||
37 | |||
38 | /** |
||
39 | * Start the timer. |
||
40 | * @param float $time optional starting point (microtime) |
||
41 | * @return self |
||
42 | */ |
||
43 | public function start( $time = null ) { |
||
51 | |||
52 | /** |
||
53 | * Stop the timer and add the duration to the total elapsed time. |
||
54 | * @return self |
||
55 | */ |
||
56 | public function stop() { |
||
66 | |||
67 | /** |
||
68 | * Determine if the timer is currently running. |
||
69 | * @return boolean |
||
70 | */ |
||
71 | public function isRunning() { |
||
74 | |||
75 | /** |
||
76 | * Return the elapsed time from last start. |
||
77 | * @return float |
||
78 | */ |
||
79 | public function getElapsed( $total = false ) { |
||
82 | |||
83 | /** |
||
84 | * Return the total elapsed time. |
||
85 | * @return float |
||
86 | */ |
||
87 | public function getTotalElapsed() { |
||
97 | |||
98 | } |
||
99 | |||
100 | // EOF |