timings: populate missing return type information

This commit is contained in:
Dylan K. Taylor 2020-01-19 17:12:13 +00:00
parent f5a18df835
commit 11cae2f0c0
2 changed files with 25 additions and 0 deletions

View File

@ -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;

View File

@ -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)]);
} }