From f850d5fa90584bb73ef1a77fd21f825e1d0794ed Mon Sep 17 00:00:00 2001 From: rxu <rxu@mail.ru> 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 <abbr> element. PHPBB3-12704 --- phpBB/phpbb/db/driver/mysqli.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'phpBB/phpbb/db/driver/mysqli.php') diff --git a/phpBB/phpbb/db/driver/mysqli.php b/phpBB/phpbb/db/driver/mysqli.php index 58361ff0f8..ad4cdaef5c 100644 --- a/phpBB/phpbb/db/driver/mysqli.php +++ b/phpBB/phpbb/db/driver/mysqli.php @@ -165,6 +165,10 @@ class mysqli extends \phpbb\db\driver\mysql_base { $this->sql_report('start', $query); } + else if (defined('PHPBB_DISPLAY_LOAD_TIME')) + { + $this->curtime = microtime(true); + } $this->query_result = ($cache && $cache_ttl) ? $cache->sql_load($query) : false; $this->sql_add_num_queries($this->query_result); @@ -180,6 +184,10 @@ class mysqli extends \phpbb\db\driver\mysql_base { $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