Permalink
Browse files

Display execution time in SQL query

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@609 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information...
jakubvrana
jakubvrana committed May 25, 2009
1 parent 0bd864e commit faa43e4c3cdea71992396dd1618055fb47881a22
Showing with 6 additions and 0 deletions.
  1. +1 −0 changes.txt
  2. +1 −0 default.css
  3. +1 −0 lang/cs.inc.php
  4. +3 −0 sql.inc.php
View
@@ -1,5 +1,6 @@
phpMinAdmin 1.10.2:
Connection through socket by server :/path/to/socket
+Display execution time in SQL query
phpMinAdmin 1.10.1:
Highlight odd and hover rows
View
@@ -22,6 +22,7 @@ code { background: #eee; }
.enum { color: #007F7F; }
.binary { color: red; }
.odd td { background: #F5F5F5; }
+.time { color: Silver; font-size: 70%; float: right; margin-top: -3em; }
tr:hover td { background: #ddf; }
thead tr:hover td { background: transparent; }
#menu { position: absolute; margin: 10px 0 0; padding: 0 0 30px 0; top: 2em; left: 0; width: 19em; overflow: auto; overflow-y: hidden; white-space: nowrap; }
View
@@ -216,4 +216,5 @@
'Stop on error' => 'Zastavit při chybě',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Byl překročen maximální povolený počet polí. Zvyšte prosím %s a %s.',
'(anywhere)' => '(kdekoliv)',
+ '%.3f s' => '%.3f s',
);
View
@@ -26,13 +26,16 @@
$empty = false;
echo "<pre class='jush-sql'>" . htmlspecialchars(substr($query, 0, $match[0][1])) . "</pre>\n";
flush();
+ $start = explode(" ", microtime());
//! don't allow changing of character_set_results, convert encoding of displayed query
if (!$dbh->multi_query(substr($query, 0, $match[0][1]))) {
echo "<p class='error'>" . lang('Error in query') . ": " . htmlspecialchars($dbh->error) . "</p>\n";
if ($_POST["error_stops"]) {
break;
}
} else {
+ $end = explode(" ", microtime());
+ echo "<p class='time'>" . lang('%.3f s', max(0, $end[0] - $start[0] + $end[1] - $start[1])) . "</p>\n";
do {
$result = $dbh->store_result();
if (is_object($result)) {

0 comments on commit faa43e4

Please sign in to comment.