1
0
mirror of https://github.com/guzzle/guzzle.git synced 2025-02-24 10:03:27 +01:00

Fix sleep calculation when waiting for delayed requests

`$nextTime` is always set in the future, and `usleep()` takes microseconds as an argument. Currently this function always returns 0 if there are no ongoing requests, clogging the CPU in the `while` loop.
This commit is contained in:
Milos Colakovic 2015-12-01 02:55:03 +01:00
parent 14c8c76919
commit 3de0df38c7

View File

@ -192,6 +192,6 @@ class CurlMultiHandler
}
}
return max(0, $currentTime - $nextTime);
return max(0, $nextTime - $currentTime) * 1000000;
}
}