add a comment to show runtime at the end of a page

This commit is contained in:
Evan Prodromou 2011-01-31 13:59:38 -05:00
parent 1543af748c
commit ca4bf54131
2 changed files with 15 additions and 0 deletions

View File

@ -37,6 +37,8 @@
* @license GNU Affero General Public License http://www.gnu.org/licenses/ * @license GNU Affero General Public License http://www.gnu.org/licenses/
*/ */
$_startTime = microtime(true);
define('INSTALLDIR', dirname(__FILE__)); define('INSTALLDIR', dirname(__FILE__));
define('STATUSNET', true); define('STATUSNET', true);
define('LACONICA', true); // compatibility define('LACONICA', true); // compatibility

View File

@ -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("<!-- ${diff}ms -->");
}
return parent::endHTML();
}
/** /**
* Show head, a template method. * Show head, a template method.
* *