Use time_sleep_until() instead of usleep(), improved thread kill

This commit is contained in:
Shoghi Cervantes
2015-05-03 23:17:39 +02:00
parent d830386786
commit 0ddf396b08
2 changed files with 6 additions and 15 deletions

View File

@@ -2186,7 +2186,7 @@ class Server{
private function tickProcessor(){
while($this->isRunning){
$this->tick();
usleep((int) max(1, ($this->nextTick - microtime(true)) * 1000000 - 2000));
time_sleep_until($this->nextTick - 0.001);
}
}