TimingsRecord: fixed incorrect violations calculation

closes #5665
This commit is contained in:
Dylan K. Taylor 2023-03-31 17:08:59 +01:00
parent 0c47455b24
commit 5ac0d7ae11
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -24,7 +24,7 @@ declare(strict_types=1);
namespace pocketmine\timings;
use pocketmine\Server;
use function round;
use function floor;
use function spl_object_id;
/**
@ -56,7 +56,7 @@ final class TimingsRecord{
if($measure){
foreach(self::$records as $record){
if($record->curTickTotal > Server::TARGET_NANOSECONDS_PER_TICK){
$record->violations += (int) round($record->curTickTotal / Server::TARGET_NANOSECONDS_PER_TICK);
$record->violations += (int) floor($record->curTickTotal / Server::TARGET_NANOSECONDS_PER_TICK);
}
$record->curTickTotal = 0;
$record->curCount = 0;