]> granicus.if.org Git - php/commitdiff
Fix test to use microtime() as time() doesn't always catchup fast enough :]
authorHannes Magnusson <bjori@php.net>
Mon, 5 Sep 2011 10:55:07 +0000 (10:55 +0000)
committerHannes Magnusson <bjori@php.net>
Mon, 5 Sep 2011 10:55:07 +0000 (10:55 +0000)
ext/standard/tests/misc/time_sleep_until_basic.phpt

index 956985a62a3726e82ce6f8b6d7da7c15a1588984..165526f0649f2a58d9dc99d5b2d5b75fe01df0b1 100644 (file)
@@ -8,9 +8,10 @@ Michele Orselli mo@ideato.it
 #PHPTestFest Cesena Italia on 2009-06-20
 --FILE--
 <?php
-  $time = time() + 2;
-  time_sleep_until( $time );
-  var_dump( time() >= $time );
+  $time = microtime(true) + 2;
+  var_dump(time_sleep_until( (int)$time ));
+  var_dump(microtime(true) >= (int)$time);
 ?>
 --EXPECT--
 bool(true)
+bool(true);