git.cweiske.de
/
phinde.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c49e769
)
performance debug timer
author
Christian Weiske
<
[email protected]
>
Fri, 2 Sep 2016 15:54:15 +0000
(17:54 +0200)
committer
Christian Weiske
<
[email protected]
>
Fri, 2 Sep 2016 15:54:15 +0000
(17:54 +0200)
src/phinde/Helper.php
patch
|
blob
|
history
diff --git
a/src/phinde/Helper.php
b/src/phinde/Helper.php
index 8e30a198609af00075f4994441ad83dc81dcfe53..00215fee0ca72b0cdb5d1fee5f175d8b46ad0202 100644
(file)
--- a/
src/phinde/Helper.php
+++ b/
src/phinde/Helper.php
@@
-65,5
+65,17
@@
class Helper
return $prot . '://' . $_SERVER['HTTP_HOST'] . $path;
}
+ static $timer = [];
+
+ public static function start($timer = 'timer')
+ {
+ static::$timer[$timer] = microtime(true);
+ }
+
+ public static function stop($timer = 'timer')
+ {
+ $diff = microtime(true) - static::$timer[$timer];
+ echo '+timer: ' . number_format($diff, 3) . 'ms ' . $timer . "\n";
+ }
}
?>