Synapse\Synapse::tick PHP Method

tick() public method

public tick ( )
    public function tick()
    {
        $this->interface->process();
        if (($time = microtime(true)) - $this->lastUpdate >= 5) {
            //Heartbeat!
            $this->lastUpdate = $time;
            $pk = new HeartbeatPacket();
            $pk->tps = $this->server->getTicksPerSecondAverage();
            $pk->load = $this->server->getTickUsageAverage();
            $pk->upTime = microtime(true) - \pocketmine\START_TIME;
            $this->sendDataPacket($pk);
        }
        if (($time = microtime(true)) - $this->lastUpdate >= 30 and $this->interface->isConnected()) {
            //30 seconds timeout
            $this->interface->reconnect();
        }
        if (microtime(true) - $this->connectionTime >= 15 and !$this->verified) {
            $this->interface->reconnect();
        }
    }