From fc4ac725d0a65397ca79554161d449e6f9107530 Mon Sep 17 00:00:00 2001 From: Dany wm Date: Thu, 7 Dec 2023 21:41:12 +0100 Subject: [PATCH] Improve DBG , add stopwatch : timer_start and timer_show --- include/lib/dbg.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/lib/dbg.php b/include/lib/dbg.php index b5ac58d43..a0570b104 100644 --- a/include/lib/dbg.php +++ b/include/lib/dbg.php @@ -134,5 +134,20 @@ EOF; EOF; return $r; } + + public static function timer_start() + { + global $timer; + $timer=hrtime(true); + } + public static function timer_show() + { + global $timer; + // $delta=$timer-microtime(true) ; + echo ''; + echo _("Temps écoulé : "); + echo (hrtime(true)-$timer)/1e+6; + echo ''; + } } ?>