Added tps into query

This commit is contained in:
ArkQuark 2022-05-13 00:27:32 +03:00
parent d18d30920f
commit 44d992dc45
2 changed files with 6 additions and 1 deletions

View file

@ -113,7 +113,11 @@ class PocketMinecraftServer{
*/
public function getTPS(){
$v = array_values($this->tickMeasure);
$tps = 40 / ($v[39] - $v[0]);
$divval = ($v[39] - $v[0]);
if($divval === 0){
return 0;
}
$tps = 40 / $divval;
return round($tps, 4);
}