mirror of
https://github.com/guzzle/guzzle.git
synced 2025-02-24 18:13:00 +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:
parent
14c8c76919
commit
3de0df38c7
@ -192,6 +192,6 @@ class CurlMultiHandler
|
||||
}
|
||||
}
|
||||
|
||||
return max(0, $currentTime - $nextTime);
|
||||
return max(0, $nextTime - $currentTime) * 1000000;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user