mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 03:47:16 +00:00
Fixed timings ticks getting reset
This commit is contained in:
parent
bcdb6d8c2e
commit
9b7a94b5ee
@ -2072,8 +2072,6 @@ class Server{
|
||||
}
|
||||
}
|
||||
|
||||
TimingsHandler::tick();
|
||||
|
||||
$this->tickMeasure = (($time = microtime(true)) - $this->tickTime);
|
||||
$this->tickTime = $time;
|
||||
$this->nextTick = 0.05 * (0.05 / max(0.05, $this->tickMeasure)) + $time;
|
||||
@ -2081,6 +2079,8 @@ class Server{
|
||||
|
||||
Timings::$serverTickTimer->stopTiming();
|
||||
|
||||
TimingsHandler::tick();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ class TimingsHandler{
|
||||
* @param string $name
|
||||
* @param TimingsHandler $parent
|
||||
*/
|
||||
public function __construct($name, $parent = null){
|
||||
public function __construct($name, TimingsHandler $parent = null){
|
||||
$this->name = $name;
|
||||
if($parent instanceof TimingsHandler){
|
||||
$this->parent = $parent;
|
||||
|
Loading…
x
Reference in New Issue
Block a user