mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-12 16:59:44 +00:00
timings: populate missing return type information
This commit is contained in:
parent
f5a18df835
commit
11cae2f0c0
@ -105,6 +105,9 @@ abstract class Timings{
|
|||||||
/** @var TimingsHandler[] */
|
/** @var TimingsHandler[] */
|
||||||
public static $pluginTaskTimingMap = [];
|
public static $pluginTaskTimingMap = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public static function init(){
|
public static function init(){
|
||||||
if(self::$initialized){
|
if(self::$initialized){
|
||||||
return;
|
return;
|
||||||
|
@ -43,6 +43,8 @@ class TimingsHandler{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param resource $fp
|
* @param resource $fp
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function printTimings($fp){
|
public static function printTimings($fp){
|
||||||
fwrite($fp, "Minecraft" . PHP_EOL);
|
fwrite($fp, "Minecraft" . PHP_EOL);
|
||||||
@ -93,6 +95,9 @@ class TimingsHandler{
|
|||||||
return self::$timingStart;
|
return self::$timingStart;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public static function reload(){
|
public static function reload(){
|
||||||
if(self::$enabled){
|
if(self::$enabled){
|
||||||
foreach(self::$HANDLERS as $timings){
|
foreach(self::$HANDLERS as $timings){
|
||||||
@ -102,6 +107,11 @@ class TimingsHandler{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param bool $measure
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public static function tick(bool $measure = true){
|
public static function tick(bool $measure = true){
|
||||||
if(self::$enabled){
|
if(self::$enabled){
|
||||||
if($measure){
|
if($measure){
|
||||||
@ -157,6 +167,9 @@ class TimingsHandler{
|
|||||||
self::$HANDLERS[spl_object_hash($this)] = $this;
|
self::$HANDLERS[spl_object_hash($this)] = $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function startTiming(){
|
public function startTiming(){
|
||||||
if(self::$enabled){
|
if(self::$enabled){
|
||||||
$this->internalStartTiming(microtime(true));
|
$this->internalStartTiming(microtime(true));
|
||||||
@ -172,6 +185,9 @@ class TimingsHandler{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function stopTiming(){
|
public function stopTiming(){
|
||||||
if(self::$enabled){
|
if(self::$enabled){
|
||||||
$this->internalStopTiming(microtime(true));
|
$this->internalStopTiming(microtime(true));
|
||||||
@ -200,6 +216,9 @@ class TimingsHandler{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function reset(){
|
public function reset(){
|
||||||
$this->count = 0;
|
$this->count = 0;
|
||||||
$this->curCount = 0;
|
$this->curCount = 0;
|
||||||
@ -210,6 +229,9 @@ class TimingsHandler{
|
|||||||
$this->timingDepth = 0;
|
$this->timingDepth = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function remove(){
|
public function remove(){
|
||||||
unset(self::$HANDLERS[spl_object_hash($this)]);
|
unset(self::$HANDLERS[spl_object_hash($this)]);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user