Fixed timings ticks getting reset

This commit is contained in:
Shoghi Cervantes 2014-09-01 01:50:28 +02:00
parent bcdb6d8c2e
commit 9b7a94b5ee
2 changed files with 3 additions and 3 deletions

View File

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

View File

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