]> granicus.if.org Git - php/commitdiff
improve timings evaluations in test
authorChristoph M. Becker <cmb@php.net>
Thu, 2 Jul 2015 08:51:26 +0000 (10:51 +0200)
committerAnatol Belski <ab@php.net>
Thu, 2 Jul 2015 12:23:06 +0000 (14:23 +0200)
ext/standard/tests/streams/proc_open_bug69900.phpt

index b3523294a7932371c10ab4fe2fd5bc702756f789..c98fd97eb4da639d1b353a9e8e2b48378821d007 100644 (file)
@@ -33,7 +33,7 @@ for($i = 0; $i < 10; $i++){
        $t1 = microtime(1);
 
        echo $s;                
-       echo "fgets() took ", (($t1 - $t0)*1000), "ms\n";
+       echo "fgets() took ", (($t1 - $t0)*1000 > 1 ? 'more' : 'less'), " than 1 ms\n";
 }
 
 fclose($pipes[0]);
@@ -48,25 +48,25 @@ proc_close($process);
 $fl = dirname(__FILE__) . DIRECTORY_SEPARATOR . "test69900.php";
 @unlink($fl);
 ?>
---EXPECTF--
+--EXPECT--
 hello0
-fgets() took %d%sms
+fgets() took more than 1 ms
 hello1
-fgets() took 0%sms
+fgets() took less than 1 ms
 hello2
-fgets() took 0%sms
+fgets() took less than 1 ms
 hello3
-fgets() took 0%sms
+fgets() took less than 1 ms
 hello4
-fgets() took 0%sms
+fgets() took less than 1 ms
 hello5
-fgets() took 0%sms
+fgets() took less than 1 ms
 hello6
-fgets() took 0%sms
+fgets() took less than 1 ms
 hello7
-fgets() took 0%sms
+fgets() took less than 1 ms
 hello8
-fgets() took 0%sms
+fgets() took less than 1 ms
 hello9
-fgets() took 0%sms
+fgets() took less than 1 ms
 ===DONE===