pocketmine\network\Network::resetStatistics PHP Method

resetStatistics() public method

public resetStatistics ( )
    public function resetStatistics()
    {
        $this->upload = 0;
        $this->download = 0;
    }

Usage Example

Beispiel #1
0
 private function titleTick()
 {
     if (!Terminal::hasFormattingCodes()) {
         return;
     }
     $d = Utils::getRealMemoryUsage();
     $u = Utils::getMemoryUsage(true);
     $usage = round($u[0] / 1024 / 1024, 2) . "/" . round($d[0] / 1024 / 1024, 2) . "/" . round($u[1] / 1024 / 1024, 2) . "/" . round($u[2] / 1024 / 1024, 2) . " MB @ " . Utils::getThreadCount() . " threads";
     echo "]0;" . $this->getName() . " " . $this->getPocketMineVersion() . " | Online " . count($this->players) . "/" . $this->getMaxPlayers() . " | Memory " . $usage . " | U " . round($this->network->getUpload() / 1024, 2) . " D " . round($this->network->getDownload() / 1024, 2) . " kB/s | TPS " . $this->getTicksPerSecond() . " | Load " . $this->getTickUsage() . "%";
     $this->network->resetStatistics();
 }
All Usage Examples Of pocketmine\network\Network::resetStatistics