pocketmine\event\TimingsHandler::stopTiming PHP Method

stopTiming() public method

public stopTiming ( )
    public function stopTiming()
    {
        if (PluginManager::$useTimings) {
            if (--$this->timingDepth !== 0 or $this->start === 0) {
                return;
            }
            $diff = microtime(true) - $this->start;
            $this->totalTime += $diff;
            $this->curTickTotal += $diff;
            ++$this->curCount;
            ++$this->count;
            $this->start = 0;
            if ($this->parent !== null) {
                $this->parent->stopTiming();
            }
        }
    }

Usage Example

 /**
  * @param Event $event
  */
 public function callEvent(Event $event)
 {
     if ($event instanceof Cancellable and $event->isCancelled() and $this->isIgnoringCancelled()) {
         return;
     }
     $this->timings->startTiming();
     $this->executor->execute($this->listener, $event);
     $this->timings->stopTiming();
 }
All Usage Examples Of pocketmine\event\TimingsHandler::stopTiming