We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5753a55 commit 2180ce3Copy full SHA for 2180ce3
1 file changed
test/phpunit/LoopTest.php
@@ -156,4 +156,18 @@ public function testHalt() {
156
$sut->run();
157
self::assertEquals(10, $tickCount);
158
}
159
+
160
+ public function testSleepActuallyDelays() {
161
+ $startEpoch = microtime(true);
162
+ $waitUntil = $startEpoch + 0.25;
163
164
+ $sut = new Loop();
165
+ $sut->waitUntil($waitUntil);
166
+ $endEpoch = microtime(true);
167
+ self::assertEquals(
168
+// The delay should be accurate to a hundredth of a second.
169
+ round($waitUntil, 2),
170
+ round($endEpoch, 2)
171
+ );
172
+ }
173
0 commit comments