当前位置: 首页>>代码示例>>PHP>>正文


PHP TimingsHandler::stopTiming方法代码示例

本文整理汇总了PHP中pocketmine\event\TimingsHandler::stopTiming方法的典型用法代码示例。如果您正苦于以下问题:PHP TimingsHandler::stopTiming方法的具体用法?PHP TimingsHandler::stopTiming怎么用?PHP TimingsHandler::stopTiming使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pocketmine\event\TimingsHandler的用法示例。


在下文中一共展示了TimingsHandler::stopTiming方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: callEvent

 /**
  * @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();
 }
开发者ID:ClearSkyTeam,项目名称:ClearSky,代码行数:12,代码来源:RegisteredListener.php

示例2: 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->count++;
         $this->start = 0;
         if ($this->parent instanceof TimingsHandler) {
             $this->parent->stopTiming();
         }
     }
 }
开发者ID:boybook,项目名称:PocketMine-MP,代码行数:16,代码来源:TimingsHandler.php

示例3: 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();
         }
     }
 }
开发者ID:xpyctum,项目名称:PocketMinePlusPlus,代码行数:17,代码来源:TimingsHandler.php

示例4: onUpdate

 public function onUpdate($currentTick)
 {
     if ($this->closed) {
         return false;
     }
     $tickDiff = max(1, $currentTick - $this->lastUpdate);
     $this->lastUpdate = $currentTick;
     $this->timings->startTiming();
     $hasUpdate = $this->entityBaseTick($tickDiff);
     $this->updateMovement();
     $this->timings->stopTiming();
     //if($this->isStatic())
     return $hasUpdate;
     //return !($this instanceof Player);
 }
开发者ID:RedstoneAlmeida,项目名称:Steadfast2,代码行数:15,代码来源:Entity.php

示例5: onUpdate

 public function onUpdate($currentTick)
 {
     if ($this->closed) {
         return false;
     }
     if (!$this->isAlive()) {
         ++$this->deadTicks;
         if ($this->deadTicks >= 10) {
             $this->despawnFromAll();
             if (!$this->isPlayer) {
                 $this->close();
             }
         }
         return $this->deadTicks < 10;
     }
     $tickDiff = $currentTick - $this->lastUpdate;
     if ($tickDiff <= 0) {
         return false;
     }
     $this->lastUpdate = $currentTick;
     $this->timings->startTiming();
     $hasUpdate = $this->entityBaseTick($tickDiff);
     $this->updateMovement();
     $this->timings->stopTiming();
     //if($this->isStatic())
     return $hasUpdate;
     //return !($this instanceof Player);
 }
开发者ID:NewDelion,项目名称:PocketMine-0.13.x,代码行数:28,代码来源:Entity.php


注:本文中的pocketmine\event\TimingsHandler::stopTiming方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。