summaryrefslogtreecommitdiff
path: root/it_dbi.class
diff options
context:
space:
mode:
Diffstat (limited to 'it_dbi.class')
-rw-r--r--it_dbi.class8
1 files changed, 4 insertions, 4 deletions
diff --git a/it_dbi.class b/it_dbi.class
index a3d2c31..24c271e 100644
--- a/it_dbi.class
+++ b/it_dbi.class
@@ -559,7 +559,7 @@ function clear()
function query($query, $p = array())
{
$p += $this->_p;
- $start = gettimeofday(true);
+ $start = hrtime(true);
if (($writing = !it::match('^(EXPLAIN|SELECT|SHOW)', $query, array('utf8' => false))))
{
@@ -594,11 +594,11 @@ function query($query, $p = array())
if ($writing && $this->_p['throttle_writes'])
{
- it::log('debug', 'dbi-throttle', round(1000000 * (gettimeofday(true) - $start) * $this->_p['throttle_writes']));
- usleep(round(1000000 * (gettimeofday(true) - $start) * $this->_p['throttle_writes']));
+ it::log('debug', 'dbi-throttle', round((hrtime(true) - $start) / 1000 * $this->_p['throttle_writes']));
+ usleep(round((hrtime(true) - $start) / 1000 * $this->_p['throttle_writes']));
}
- $msec = round(1000 * (gettimeofday(true) - $start));
+ $msec = round((hrtime(true) - $start) / 1_000_000);
$slow = $msec >= 2000;
if ($GLOBALS['debug_sqllog'] || $GLOBALS['debug_sqltrace'] || $slow)
{