From f850d5fa90584bb73ef1a77fd21f825e1d0794ed Mon Sep 17 00:00:00 2001 From: rxu Date: Sat, 14 Jun 2014 20:53:34 +0800 Subject: [ticket/12704] Improve the load time information in the footer when enabled PR #2570 has added new constant to display load time information without debug mode is being on (https://tracker.phpbb.com/browse/PHPBB3-12687). This patch expands the total load time info with SQL/PHP load times, while hiding the additional info with element. PHPBB3-12704 --- phpBB/phpbb/db/driver/sqlite3.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'phpBB/phpbb/db/driver/sqlite3.php') diff --git a/phpBB/phpbb/db/driver/sqlite3.php b/phpBB/phpbb/db/driver/sqlite3.php index 2c6bf99497..6511c755a0 100644 --- a/phpBB/phpbb/db/driver/sqlite3.php +++ b/phpBB/phpbb/db/driver/sqlite3.php @@ -121,6 +121,10 @@ class sqlite3 extends \phpbb\db\driver\driver { $this->sql_report('start', $query); } + else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + { + $this->curtime = microtime(true); + } $this->last_query_text = $query; $this->query_result = ($cache && $cache_ttl) ? $cache->sql_load($query) : false; @@ -137,6 +141,10 @@ class sqlite3 extends \phpbb\db\driver\driver { $this->sql_report('stop', $query); } + else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + { + $this->sql_time += microtime(true) - $this->curtime; + } if ($cache && $cache_ttl) { -- cgit v1.2.1