From 78a4a04cdf99dcfa202277f1920cf30016bdf880 Mon Sep 17 00:00:00 2001 From: Torsten Date: Tue, 7 Aug 2018 14:15:02 +0200 Subject: [PATCH] Start of timelogging with own TimeLogger class --- pfosten/app/MyClasses/TimeLogger.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 pfosten/app/MyClasses/TimeLogger.php diff --git a/pfosten/app/MyClasses/TimeLogger.php b/pfosten/app/MyClasses/TimeLogger.php new file mode 100644 index 00000000..86b9bbf7 --- /dev/null +++ b/pfosten/app/MyClasses/TimeLogger.php @@ -0,0 +1,23 @@ +startTime = microtime(true); + $this->functionName =$_functionName; + $this->pkey="".rand(1000,9999); + } + + public function getStartMessage() { + return "[CLOCK] [".$this->pkey."-".$this->functionName."] [started]"; + } + + public function getEndMessage() { + return "[CLOCK] [".$this->pkey."-". $this->functionName."] [ended] [elapsed: ".number_format( ( microtime(true) - $this->startTime), 4)."]"; + } +} \ No newline at end of file