public static function microSleep(int $microseconds) { Server::$sleeper->synchronized(function (int $ms) { Server::$sleeper->wait($ms); }, $microseconds); }
public function stop() { for ($n = 0; $n < $this->threads; ++$n) { $this->workers[$n]->close(); Server::microSleep(50000); $this->workers[$n]->kill(); } @socket_close($this->socket); $this->threads = 0; }