diff options
author | Simon Rettberg | 2018-01-04 18:29:51 +0100 |
---|---|---|
committer | Simon Rettberg | 2018-01-04 18:29:51 +0100 |
commit | b16e404dd98ed9536f1a048090c48fbab2225b19 (patch) | |
tree | 0e556157141cd98b11547ec61bff1e8c5f6807d9 /index.php | |
parent | [exams] reworked permission system from "click and you get error" to "button ... (diff) | |
download | slx-admin-b16e404dd98ed9536f1a048090c48fbab2225b19.tar.gz slx-admin-b16e404dd98ed9536f1a048090c48fbab2225b19.tar.xz slx-admin-b16e404dd98ed9536f1a048090c48fbab2225b19.zip |
[inc/Database] Add profiling info (timing, query count)
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -12,6 +12,8 @@ if (CONFIG_SQL_PASS === '%MYSQL_OPENSLX_PASS%') { require_once('inc/user.inc.php'); +$global_start = microtime(true); + /** * Page class which all module's pages must be extending from */ @@ -213,6 +215,13 @@ if (defined('CONFIG_DEBUG') && CONFIG_DEBUG) { if (defined('CONFIG_FOOTER')) { Render::addTemplate('footer', array('text' => CONFIG_FOOTER), 'main'); } +if (CONFIG_DEBUG) { + $duration = microtime(true) - $global_start; + Render::addTemplate('footer', array('text' => + round($duration, 3) . 's, ' + . Database::getQueryCount() . ' queries, ' + . round(Database::getQueryTime(), 3) . 's query time total'), 'main'); +} Render::addTemplate('tm-callback-trigger', array(), 'main'); |