Merge pull request #2241 from TimHas/develop

Added small feature to profiler: total execution time count
diff --git a/system/language/english/profiler_lang.php b/system/language/english/profiler_lang.php
index dfe034e..0ed5f4c 100644
--- a/system/language/english/profiler_lang.php
+++ b/system/language/english/profiler_lang.php
@@ -46,6 +46,7 @@
 $lang['profiler_no_profiles']	= 'No Profile data - all Profiler sections have been disabled.';
 $lang['profiler_section_hide']	= 'Hide';
 $lang['profiler_section_show']	= 'Show';
+$lang['profiler_seconds']		= 'seconds';
 
 /* End of file profiler_lang.php */
 /* Location: ./system/language/english/profiler_lang.php */
\ No newline at end of file
diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php
index e932399..ac8f6ba 100644
--- a/system/libraries/Profiler.php
+++ b/system/libraries/Profiler.php
@@ -238,6 +238,8 @@
 		foreach ($dbs as $name => $db)
 		{
 			$hide_queries = (count($db->queries) > $this->_query_toggle_count) ? ' display:none' : '';
+			
+			$total_time = number_format(array_sum($db->query_times), 4).' '.$this->CI->lang->line('profiler_seconds');
 
 			$show_hide_js = '(<span style="cursor: pointer;" onclick="var s=document.getElementById(\'ci_profiler_queries_db_'.$count.'\').style;s.display=s.display==\'none\'?\'\':\'none\';this.innerHTML=this.innerHTML==\''.$this->CI->lang->line('profiler_section_hide').'\'?\''.$this->CI->lang->line('profiler_section_show').'\':\''.$this->CI->lang->line('profiler_section_hide').'\';">'.$this->CI->lang->line('profiler_section_hide').'</span>)';
 
@@ -250,7 +252,7 @@
 				."\n"
 				.'<legend style="color:#0000FF;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_database')
 				.':&nbsp; '.$db->database.' ('.$name.')&nbsp;&nbsp;&nbsp;'.$this->CI->lang->line('profiler_queries')
-				.': '.count($db->queries).'&nbsp;&nbsp;'.$show_hide_js."</legend>\n\n\n"
+				.': '.count($db->queries).'('.$total_time.')'.'&nbsp;&nbsp;'.$show_hide_js."</legend>\n\n\n"
 				.'<table style="width:100%;'.$hide_queries.'" id="ci_profiler_queries_db_'.$count."\">\n";
 
 			if (count($db->queries) === 0)
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index 893c3db..3969943 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -271,7 +271,9 @@
    -  :doc:`Encryption Library <libraries/encryption>` changes include:
 	 -  Added support for hashing algorithms other than SHA1 and MD5.
 	 -  Removed previously deprecated ``sha1()`` method.
-   -  :doc:`Profiler Library <general/profiling>` now also displays database object names.
+   -  :doc:`Profiler Library <general/profiling>` changes include:
+	 -  Database object names displayed.
+	 -  The sum of all queries running times in seconds displayed.
    -  :doc:`Migration Library <libraries/migration>` changes include:
 	 -  Added support for timestamp-based migrations (enabled by default).
 	 -  Added ``$config['migration_type']`` to allow switching between *sequential* and *timestamp* migrations.