mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-12 00:39:45 +00:00
Timings: add a dedicated field for checking initialization
This commit is contained in:
parent
92be8c8ec0
commit
46930b98b7
@ -31,6 +31,8 @@ use pocketmine\tile\Tile;
|
||||
use function dechex;
|
||||
|
||||
abstract class Timings{
|
||||
/** @var bool */
|
||||
private static $initialized = false;
|
||||
|
||||
/** @var TimingsHandler */
|
||||
public static $fullTickTimer;
|
||||
@ -104,9 +106,10 @@ abstract class Timings{
|
||||
public static $pluginTaskTimingMap = [];
|
||||
|
||||
public static function init(){
|
||||
if(self::$serverTickTimer instanceof TimingsHandler){
|
||||
if(self::$initialized){
|
||||
return;
|
||||
}
|
||||
self::$initialized = true;
|
||||
|
||||
self::$fullTickTimer = new TimingsHandler("Full Server Tick");
|
||||
self::$serverTickTimer = new TimingsHandler("** Full Server Tick", self::$fullTickTimer);
|
||||
|
Loading…
x
Reference in New Issue
Block a user