summaryrefslogtreecommitdiffstats
path: root/system/database/DB_driver.php
diff options
context:
space:
mode:
authorDerek Jones <derek.jones@ellislab.com>2008-01-23 18:26:37 +0100
committerDerek Jones <derek.jones@ellislab.com>2008-01-23 18:26:37 +0100
commit56e9fa581b9e7d590dfb56482b898339f29bd8f2 (patch)
tree52b18faa17bde54d6287eb2700f49421afc56e0c /system/database/DB_driver.php
parentdb708af87341897cbc7fd1157291377c253d371f (diff)
added $query_times property to DB driver for profiling
added individual query execution time to profiler output
Diffstat (limited to 'system/database/DB_driver.php')
-rw-r--r--system/database/DB_driver.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index 65be13dc9..dbd54bebe 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -48,6 +48,7 @@ class CI_DB_driver {
var $bind_marker = '?';
var $save_queries = TRUE;
var $queries = array();
+ var $query_times = array();
var $data_cache = array();
var $trans_enabled = TRUE;
var $_trans_depth = 0;
@@ -341,6 +342,11 @@ class CI_DB_driver {
$time_end = list($em, $es) = explode(' ', microtime());
$this->benchmark += ($em + $es) - ($sm + $ss);
+ if ($this->save_queries == TRUE)
+ {
+ $this->query_times[] = ($em + $es) - ($sm + $ss);
+ }
+
// Increment the query counter
$this->query_count++;