Skip to content

Commit 09cd0bc

Browse files
committed
Add StreamSelectLoop timeout rounding.
1 parent bdc6191 commit 09cd0bc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/StreamSelectLoop.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,11 @@ public function run()
159159
if ($timeout < 0) {
160160
$timeout = 0;
161161
} else {
162-
$timeout *= self::MICROSECONDS_PER_SECOND;
162+
/*
163+
* round() needed to correct float error:
164+
* https://github.com/reactphp/event-loop/issues/48
165+
*/
166+
$timeout = round($timeout * self::MICROSECONDS_PER_SECOND);
163167
}
164168

165169
// The only possible event is stream activity, so wait forever ...

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy