Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
35 | 13 | public static function timeSinceExecutionStart() : float |
|
36 | { |
||
37 | 13 | if (isset($_SERVER['REQUEST_TIME_FLOAT'])) { |
|
38 | 11 | $startOfRequest = $_SERVER['REQUEST_TIME_FLOAT']; |
|
39 | 2 | } elseif (isset($_SERVER['REQUEST_TIME'])) { |
|
40 | 1 | $startOfRequest = $_SERVER['REQUEST_TIME']; |
|
41 | } else { |
||
42 | 1 | throw new RuntimeException('Cannot determine time at which the execution started'); |
|
43 | } |
||
44 | 12 | return \microtime(true) - $startOfRequest; |
|
45 | } |
||
46 | |||
67 |