Measures basic query time [#571934]

This commit is contained in:
Garvin Hicking
2003-02-24 16:19:15 +00:00
parent 385a7f69ac
commit 78d34767d0
2 changed files with 12 additions and 1 deletions

View File

@@ -296,8 +296,17 @@ else {
$num_rows = 0;
}
else {
// garvin: Measure query time. TODO-Item http://sourceforge.net/tracker/index.php?func=detail&aid=571934&group_id=23067&atid=377411
list($usec, $sec) = explode(' ',microtime());
$querytime_before = ((float)$usec + (float)$sec);
$result = @PMA_mysql_query($full_sql_query);
list($usec, $sec) = explode(' ',microtime());
$querytime_after = ((float)$usec + (float)$sec);
$GLOBALS['querytime'] = $querytime_after - $querytime_before;
// Displays an error message if required and stop parsing the script
if (PMA_mysql_error()) {
$error = PMA_mysql_error();
@@ -449,6 +458,8 @@ else {
$message = $strEmptyResultSet;
}
$message .= " (" . sprintf($strQueryTime, $GLOBALS['querytime']) . ")";
if ($is_gotofile) {
$goto = ereg_replace('\.\.*', '.', $goto);
// Checks for a valid target script