LevelManager: add debug message when a level takes too long to tick

This commit is contained in:
Dylan K. Taylor 2019-03-03 13:26:16 +00:00
parent 6bd43a8215
commit c3e66e0adc

View File

@ -346,6 +346,9 @@ class LevelManager{
$level->doTick($currentTick);
$tickMs = (microtime(true) - $levelTime) * 1000;
$level->tickRateTime = $tickMs;
if($tickMs >= 50){
$this->server->getLogger()->debug(sprintf("World \"%s\" took too long to tick: %gms (%g ticks)", $level->getDisplayName(), $tickMs, round($tickMs / 50, 2)));
}
}
if($this->autoSave and ++$this->autoSaveTicker >= $this->autoSaveTicks){