From: Evan Prodromou Date: Mon, 31 Jan 2011 18:59:38 +0000 (-0500) Subject: add a comment to show runtime at the end of a page X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ca4bf541310eb36fae5a69697bba76a2211218f4;p=quix0rs-gnu-social.git add a comment to show runtime at the end of a page --- diff --git a/index.php b/index.php index 6f011e7e5b..37c157b01f 100644 --- a/index.php +++ b/index.php @@ -37,6 +37,8 @@ * @license GNU Affero General Public License http://www.gnu.org/licenses/ */ +$_startTime = microtime(true); + define('INSTALLDIR', dirname(__FILE__)); define('STATUSNET', true); define('LACONICA', true); // compatibility diff --git a/lib/action.php b/lib/action.php index 0e5d7ae361..24d7527196 100644 --- a/lib/action.php +++ b/lib/action.php @@ -111,6 +111,19 @@ class Action extends HTMLOutputter // lawsuit } } + function endHTML() + { + global $_startTime; + + if (isset($_startTime)) { + $endTime = microtime(true); + $diff = round(($endTime - $_startTime) * 1000); + $this->raw(""); + } + + return parent::endHTML(); + } + /** * Show head, a template method. *