aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/functions.inc.php')
-rw-r--r--include/functions.inc.php15
1 files changed, 7 insertions, 8 deletions
diff --git a/include/functions.inc.php b/include/functions.inc.php
index 915a1b6b6..adbbce358 100644
--- a/include/functions.inc.php
+++ b/include/functions.inc.php
@@ -461,24 +461,23 @@ function pwg_write_debug()
function pwg_query($query)
{
- global $conf;
+ global $conf,$count_queries,$queries_time;
$start = get_moment();
$result = mysql_query($query);
-
+
+ $time = get_moment() - $start;
+ $count_queries++;
+ $queries_time+= $time;
+
if ($conf['show_queries'])
{
- global $count_queries,$queries_time;
-
- $time = get_moment() - $start;
- $count_queries++;
-
$output = '';
$output.= '<pre>['.$count_queries.'] '."\n".$query;
- $queries_time+= $time;
$output.= "\n".'(this query time : '.number_format( $time, 3, '.', ' ').' s)</b>';
$output.= "\n".'(total SQL time : '.number_format( $queries_time, 3, '.', ' ').' s)';
$output.= '</pre>';
+
echo $output;
}