mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +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->tickMeasure = (($time = microtime(true)) - $this->tickTime);
|
||||||
$this->tickTime = $time;
|
$this->tickTime = $time;
|
||||||
$this->nextTick = 0.05 * (0.05 / max(0.05, $this->tickMeasure)) + $time;
|
$this->nextTick = 0.05 * (0.05 / max(0.05, $this->tickMeasure)) + $time;
|
||||||
@ -2081,6 +2079,8 @@ class Server{
|
|||||||
|
|
||||||
Timings::$serverTickTimer->stopTiming();
|
Timings::$serverTickTimer->stopTiming();
|
||||||
|
|
||||||
|
TimingsHandler::tick();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ class TimingsHandler{
|
|||||||
* @param string $name
|
* @param string $name
|
||||||
* @param TimingsHandler $parent
|
* @param TimingsHandler $parent
|
||||||
*/
|
*/
|
||||||
public function __construct($name, $parent = null){
|
public function __construct($name, TimingsHandler $parent = null){
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
if($parent instanceof TimingsHandler){
|
if($parent instanceof TimingsHandler){
|
||||||
$this->parent = $parent;
|
$this->parent = $parent;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user