tick = false; $this->lastTick = 0; $this->server = ServerAPI::request(); } public function run(){ while($this->stop !== true){ usleep(1); $time = microtime(true); if($this->lastTick <= ($time - 0.05)){ $this->lastTick = $time; $this->tick = true; $this->wait(); $this->tick = false; } } exit(0); } }