Beispiel #1
0
 /**
  * Stops the active profile
  *
  * @return \Phalcon\Db\Profiler
  */
 public function stopProfile()
 {
     $finalTime = microtime(true);
     $activeProfile = $this->_activeProfile;
     $this->_activeProfile->setFinalTime($finalTime);
     $difference = $finalTime - $activeProfile->getInitialTime();
     $this->_totalSeconds = $this->_totalSeconds + $difference;
     if (is_array($this->_allProfiles) === false) {
         $this->_allProfiles = array();
     }
     $this->_allProfiles[] = $activeProfile;
     if (method_exists($this, 'afterEndProfile') === true) {
         $this->afterEndProfile($activeProfile);
     }
     return $this;
 }
Beispiel #2
0
 /**
  * Executed after the SQL statement was sent to the db server
  */
 public function afterEndProfile(Item $profile)
 {
     echo $profile->getTotalElapsedSeconds();
 }