]> granicus.if.org Git - php/commitdiff
Run gmp_random tests more quickly
authorNikita Popov <nikic@php.net>
Thu, 16 Apr 2015 14:29:57 +0000 (16:29 +0200)
committerNikita Popov <nikic@php.net>
Thu, 16 Apr 2015 14:29:57 +0000 (16:29 +0200)
ext/gmp/tests/gmp_random_bits.phpt
ext/gmp/tests/gmp_random_range.phpt

index 21d493cdb6184855b3507e26576334f0a5f0fc74..b4aa5d7b732b273ba946d5bd38aa457ec4ce1e6b 100644 (file)
@@ -13,7 +13,7 @@ var_dump(gmp_random_bits(-1));
 gmp_random_bits(1);
 gmp_random_bits(1024);
 
-// 2 seconds to make sure the numbers stay in range
+// 0.5 seconds to make sure the numbers stay in range
 $start = microtime(true);
 $limit = (2 ** 30) - 1;
 while (1) {
@@ -26,7 +26,7 @@ while (1) {
                }
        }
 
-       if (microtime(true) - $start > 2) {
+       if (microtime(true) - $start > 0.5) {
                break;
        }
 }
index a8e7c4a9c12f124b8116ed3abe93258ae09731f3..db2ece61c5386c4d322b573588d4390898ce1eb5 100644 (file)
@@ -30,7 +30,7 @@ gmp_random_range(-1, $plusTen);
 gmp_random_range($zero, $plusTen);
 gmp_random_range($minusTen, $plusTen);
 
-// 2 seconds to make sure the numbers stay in range
+// 0.5 seconds to make sure the numbers stay in range
 $start = microtime(true);
 while (1) {
        for ($i = 0; $i < 5000; $i++) {
@@ -56,7 +56,7 @@ while (1) {
                }
        }
 
-       if (microtime(true) - $start > 2) {
+       if (microtime(true) - $start > 0.5) {
                break;
        }
 }