Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
Performance | n/a |
0 / 0 |
n/a |
0 / 0 |
2 | n/a |
0 / 0 |
|||
addMark | n/a |
0 / 0 |
n/a |
0 / 0 |
1 | |||||
writeMark | n/a |
0 / 0 |
n/a |
0 / 0 |
1 |
1 | <?php |
2 | |
3 | namespace BO\Zmsdb\Helper; |
4 | |
5 | /** |
6 | * @codeCoverageIgnore |
7 | */ |
8 | class Performance |
9 | { |
10 | public static $times = []; |
11 | public static $counter = 0; |
12 | |
13 | public static function addMark() |
14 | { |
15 | array_push(self::$times, microtime(true)); |
16 | } |
17 | |
18 | public static function writeMark($message = 'Stopped time') |
19 | { |
20 | $lastTime = array_pop(self::$times); |
21 | $timeDiff = microtime(true) - $lastTime; |
22 | error_log(sprintf("%03d %f \t%s", static::$counter++, $timeDiff, "$message")); |
23 | return $timeDiff; |
24 | } |
25 | } |