noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 05/34: Improve DBG , add stopwatch : timer_st


From: dwm
Subject: [Noalyss-commit] [noalyss] 05/34: Improve DBG , add stopwatch : timer_start and timer_show
Date: Wed, 17 Jan 2024 12:54:05 -0500 (EST)

sparkyx pushed a commit to branch devel
in repository noalyss.

commit 3c570c042b91e50d042e4806472a0509dfb93f93
Author: Dany wm <danydb@noalyss.eu>
AuthorDate: Thu Dec 7 21:41:12 2023 +0100

    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 '<span style="font-size:80%;color:navy;background:lightgreen">';
+        echo _("Temps écoulé : ");
+        echo (hrtime(true)-$timer)/1e+6;
+        echo '</span>';
+    }
 }
 ?>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]