From 923b4e1166b8ab6e43523506fb87e4a141d499ac Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 20 Nov 2009 10:35:07 +0000 Subject: [PATCH] Removed needless function get_MicroTimeDiff. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14831 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_ldap.inc | 12 ++++++------ gosa-core/include/functions.inc | 14 -------------- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/gosa-core/include/class_ldap.inc b/gosa-core/include/class_ldap.inc index f0e3fe1f8..463f6b9e1 100644 --- a/gosa-core/include/class_ldap.inc +++ b/gosa-core/include/class_ldap.inc @@ -219,7 +219,7 @@ class LDAP{ if($this->hascon){ if ($this->reconnect) $this->connect(); - $start = microtime(); + $start = microtime(true); $this->clearResult($srp); $this->sr[$srp] = @ldap_search($this->cid, LDAP::fix($this->basedn), $filter, $attrs); $this->error = @ldap_error($this->cid); @@ -228,13 +228,13 @@ class LDAP{ /* Check if query took longer as specified in max_ldap_query_time */ if($this->max_ldap_query_time){ - $diff = get_MicroTimeDiff($start,microtime()); + $diff = microtime(true) - $start; if($diff > $this->max_ldap_query_time){ msg_dialog::display(_("Performance warning"), sprintf(_("LDAP performance is poor: last query took about %.2fs!"), $diff), WARNING_DIALOG); } } - $this->log("LDAP operation: time=".get_MicroTimeDiff($start,microtime())." operation=search('".LDAP::fix($this->basedn)."', '$filter')"); + $this->log("LDAP operation: time=".(microtime(true)-$start)." operation=search('".LDAP::fix($this->basedn)."', '$filter')"); return($this->sr[$srp]); }else{ $this->error = "Could not connect to LDAP server"; @@ -253,7 +253,7 @@ class LDAP{ else $basedn= LDAP::convert($basedn); - $start = microtime(); + $start = microtime(true); $this->sr[$srp] = @ldap_list($this->cid, LDAP::fix($basedn), $filter,$attrs); $this->error = @ldap_error($this->cid); $this->resetResult($srp); @@ -261,13 +261,13 @@ class LDAP{ /* Check if query took longer as specified in max_ldap_query_time */ if($this->max_ldap_query_time){ - $diff = get_MicroTimeDiff($start,microtime()); + $diff = microtime(true) - $start; if($diff > $this->max_ldap_query_time){ msg_dialog::display(_("Performance warning"), sprintf(_("LDAP performance is poor: last query took about %.2fs!"), $diff), WARNING_DIALOG); } } - $this->log("LDAP operation: time=".get_MicroTimeDiff($start,microtime())." operation=ls('".LDAP::fix($basedn)."', '$filter')"); + $this->log("LDAP operation: time=".(microtime(true) - $start)." operation=ls('".LDAP::fix($basedn)."', '$filter')"); return($this->sr[$srp]); }else{ diff --git a/gosa-core/include/functions.inc b/gosa-core/include/functions.inc index 20d09e27e..fffa4c6ca 100644 --- a/gosa-core/include/functions.inc +++ b/gosa-core/include/functions.inc @@ -2076,20 +2076,6 @@ function normalizeLdap($input) } -/* Resturns the difference between to microtime() results in float */ -function get_MicroTimeDiff($start , $stop) -{ - $a = split("\ ",$start); - $b = split("\ ",$stop); - - $secs = $b[1] - $a[1]; - $msecs= $b[0] - $a[0]; - - $ret = (float) ($secs+ $msecs); - return($ret); -} - - function get_base_dir() { global $BASE_DIR; -- 2.30.2