X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fdb%2Flib-mysql3.php;h=b64e3937ec828ef647e2bec44dc6b9be87949201;hp=f9f1e74d0241bb86b4d544b89edab0247797ca9d;hb=114d6b94e8c2aa1ec5c79465fb2011196ec6f70b;hpb=0e500eb441c95d3128835dfabab1de1f528caed2
diff --git a/inc/db/lib-mysql3.php b/inc/db/lib-mysql3.php
index f9f1e74d02..b64e3937ec 100644
--- a/inc/db/lib-mysql3.php
+++ b/inc/db/lib-mysql3.php
@@ -44,30 +44,39 @@ function SQL_QUERY($sql_string, $F, $L) {
// Remove \t, \n and \r from queries they may confuse some MySQL version I have heard
$sql_string = str_replace("\t", " ", str_replace("\n", " ", str_replace("\r", " ", $sql_string)));
+ // Starting time
+ $querytimeBefore = array_sum(explode(' ', microtime()));
+
// Run SQL command
$result = @mysql_query($sql_string, $link)
or ADD_FATAL($F." (".$L."):".mysql_error()."
".MYSQL_QUERY_STRING."
".$sql_string);
- // Count this query
- if (!isset($_CONFIG['sql_count'])) $_CONFIG['sql_count'] = 0;
- $_CONFIG['sql_count']++;
+ // Starting time
+ $querytimeAfter = array_sum(explode(' ', microtime()));
+
+ // Calculate query time
+ $queryTime = $querytimeAfter - $querytimeBefore;
+
+ // Count this query
+ if (!isset($_CONFIG['sql_count'])) $_CONFIG['sql_count'] = 0;
+ $_CONFIG['sql_count']++;
- // Debug output
- //* DEBUG: */ print "Query=
".$sql_string.", affected=".SQL_AFFECTEDROWS().", numrows=".SQL_NUMROWS($result)."
".$sql_string.", affected=".SQL_AFFECTEDROWS().", numrows=".SQL_NUMROWS($result)."