diff --git a/lib/Loop/NativeDriver.php b/lib/Loop/NativeDriver.php index ac2d0ad..045f2a1 100644 --- a/lib/Loop/NativeDriver.php +++ b/lib/Loop/NativeDriver.php @@ -276,7 +276,7 @@ class NativeDriver extends Driver continue; } - $expiration -= getCurrentTime(); + $expiration -= $this->now(); if ($expiration < 0) { return 0; diff --git a/test/Loop/DriverTest.php b/test/Loop/DriverTest.php index 9bec2ca..c28fbeb 100644 --- a/test/Loop/DriverTest.php +++ b/test/Loop/DriverTest.php @@ -1563,8 +1563,8 @@ abstract class DriverTest extends TestCase $new = $this->loop->now(); // Allow a few milliseconds of inaccuracy. - $this->assertGreaterThanOrEqual($now - 5, $new); - $this->assertLessThanOrEqual($now + 5, $new); + $this->assertGreaterThanOrEqual($now - 1, $new); + $this->assertLessThanOrEqual($now + 10, $new); // Same time should be returned from later call. $this->assertSame($new, $this->loop->now()); diff --git a/test/LoopTest.php b/test/LoopTest.php index 19755ff..aec6a9f 100644 --- a/test/LoopTest.php +++ b/test/LoopTest.php @@ -55,8 +55,8 @@ class LoopTest extends TestCase $new = Loop::now(); // Allow a few milliseconds of inaccuracy. - $this->assertGreaterThanOrEqual($now - 5, $new); - $this->assertLessThanOrEqual($now + 5, $new); + $this->assertGreaterThanOrEqual($now - 1, $new); + $this->assertLessThanOrEqual($now + 10, $new); // Same time should be returned from later call. $this->assertSame($new, Loop::now());