[phpwebapp-commits] CVS: web_app/timer class.Timer.php,1.8,1.9
Brought to you by:
dashohoxha
From: Dashamir H. <das...@us...> - 2004-07-22 16:26:20
|
Update of /cvsroot/phpwebapp/web_app/timer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9224/timer Modified Files: class.Timer.php Log Message: reformated and modified the copyleft notice Index: class.Timer.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/timer/class.Timer.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** class.Timer.php 15 Jul 2004 14:46:04 -0000 1.8 --- class.Timer.php 22 Jul 2004 16:25:36 -0000 1.9 *************** *** 1,21 **** <?php /* ! Copyright 2001,2002,2003 Dashamir Hoxha, das...@us... ! This file is part of phpWebApp. ! phpWebApp is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2 of the License, or ! (at your option) any later version. ! phpWebApp is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! You should have received a copy of the GNU General Public License ! along with phpWebApp; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ --- 1,22 ---- <?php /* ! This file is part of phpWebApp, which is a framework for building web ! application based on relational databases. ! Copyright 2001,2002,2003,2004 Dashamir Hoxha, das...@us... ! phpWebApp is free software; you can redistribute it and/or modify it ! under the terms of the GNU General Public License as published by the ! Free Software Foundation; either version 2 of the License, or (at your ! option) any later version. ! phpWebApp is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! You should have received a copy of the GNU General Public License ! along with phpWebApp; if not, write to the Free Software Foundation, ! Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ *************** *** 31,73 **** function Timer() ! { ! $this->info = array(); ! } function Start($processID, $comment) ! { ! if (!EXECUTION_TIME_INFO) return; ! $this->info[$processID]["comment"] = $comment; ! $this->info[$processID]["startTime"] = microtime(); ! } function Stop($processID) ! { ! if (!EXECUTION_TIME_INFO) return; ! $this->info[$processID]["endTime"] = microtime(); ! } function GetTime($processID) ! { ! if (!EXECUTION_TIME_INFO) return; ! $startTime = $this->info[$processID]["startTime"]; ! list($usec1, $sec1) = explode(" ", $startTime); ! $endTime = $this->info[$processID]["endTime"]; ! list($usec2, $sec2) = explode(" ", $endTime); ! $micro_sec = ($sec2 - $sec1)*1000000 + ($usec2 - $usec1); ! return $micro_sec / 1000; //return milisecs ! } function toHtmlTable() ! { ! if (!EXECUTION_TIME_INFO) return; ! $html = $this->JSTimer_toHtmlTable(); ! $html .= " <table bgcolor='#aaaaaa' border='0' cellspacing='1' cellpadding='2'> <tr> --- 32,74 ---- function Timer() ! { ! $this->info = array(); ! } function Start($processID, $comment) ! { ! if (!EXECUTION_TIME_INFO) return; ! $this->info[$processID]["comment"] = $comment; ! $this->info[$processID]["startTime"] = microtime(); ! } function Stop($processID) ! { ! if (!EXECUTION_TIME_INFO) return; ! $this->info[$processID]["endTime"] = microtime(); ! } function GetTime($processID) ! { ! if (!EXECUTION_TIME_INFO) return; ! $startTime = $this->info[$processID]["startTime"]; ! list($usec1, $sec1) = explode(" ", $startTime); ! $endTime = $this->info[$processID]["endTime"]; ! list($usec2, $sec2) = explode(" ", $endTime); ! $micro_sec = ($sec2 - $sec1)*1000000 + ($usec2 - $usec1); ! return $micro_sec / 1000; //return milisecs ! } function toHtmlTable() ! { ! if (!EXECUTION_TIME_INFO) return; ! $html = $this->JSTimer_toHtmlTable(); ! $html .= " <table bgcolor='#aaaaaa' border='0' cellspacing='1' cellpadding='2'> <tr> *************** *** 82,90 **** </tr>"; ! while ( list($processID, $timeInfo) = each($this->info) ) ! { ! $comment = $timeInfo["comment"]; ! $executionTime = $this->GetTime($processID); ! $html .= " <tr> <td bgcolor='#f9f9f9'> $processID </td> --- 83,91 ---- </tr>"; ! while ( list($processID, $timeInfo) = each($this->info) ) ! { ! $comment = $timeInfo["comment"]; ! $executionTime = $this->GetTime($processID); ! $html .= " <tr> <td bgcolor='#f9f9f9'> $processID </td> *************** *** 92,107 **** <td bgcolor='#f9f9f9'><xmp>$comment</xmp></td> </tr>"; ! } ! $html .= "</table>"; ! return $html; ! } function JSTimer() ! { ! if (!EXECUTION_TIME_INFO) return ""; ! $timer_path = WebApp::to_url(TIMER_PATH); ! $js_code = " <script type=\"text/javascript\" language=\"javascript\" src=\"".$timer_path."class.Timer.js\"></script> <script type=\"text/javascript\" language=\"javascript\"> --- 93,108 ---- <td bgcolor='#f9f9f9'><xmp>$comment</xmp></td> </tr>"; ! } ! $html .= "</table>"; ! return $html; ! } function JSTimer() ! { ! if (!EXECUTION_TIME_INFO) return ""; ! $timer_path = WebApp::to_url(TIMER_PATH); ! $js_code = " <script type=\"text/javascript\" language=\"javascript\" src=\"".$timer_path."class.Timer.js\"></script> <script type=\"text/javascript\" language=\"javascript\"> *************** *** 113,122 **** </script> "; ! return $js_code; ! } function JSTimer_toHtmlTable() ! { ! $js_code = " <script type=\"text/javascript\" language=\"javascript\"> //<![CDATA[ --- 114,123 ---- </script> "; ! return $js_code; ! } function JSTimer_toHtmlTable() ! { ! $js_code = " <script type=\"text/javascript\" language=\"javascript\"> //<![CDATA[ *************** *** 128,133 **** </script> "; ! return $js_code; ! } } ?> \ No newline at end of file --- 129,134 ---- </script> "; ! return $js_code; ! } } ?> \ No newline at end of file |