Example #1
0
 /**
  * Executes stop or start methods on $_stat object
  *
  * @param string $action
  * @param string $timerId
  * @param int $time
  * @param int $realMemory
  * @param int $emallocMemory
  */
 protected function _executeTimerAction($action, $timerId, $time = 0, $realMemory = 0, $emallocMemory = 0)
 {
     switch ($action) {
         case 'start':
             $this->_stat->start($timerId, $time, $realMemory, $emallocMemory);
             break;
         case 'stop':
             $this->_stat->stop($timerId, $time, $realMemory, $emallocMemory);
             break;
         default:
             $this->fail("Unexpected action '{$action}'");
             break;
     }
 }
 /**
  * Test stop method
  */
 public function testStop()
 {
     $this->_stat->expects($this->once())->method('stop')->with('timer_id', $this->greaterThanOrEqual(microtime(true)), $this->greaterThanOrEqual(0), $this->greaterThanOrEqual(0));
     $this->_driver->stop('timer_id');
 }
Example #3
0
 /**
  * Stop recording statistics for specified timer.
  *
  * @param string $timerId
  * @return void
  */
 public function stop($timerId)
 {
     $this->_stat->stop($timerId, microtime(true), memory_get_usage(true), memory_get_usage());
 }