Don't use Aast.Any when marking expressions as type Tany
[hiphop-php.git] / hphp / test / large_memory / repo_contention.php
blob678226f55ca56f08870a4f5739cdcda03c680b0b
1 <?hh
3 function foobar($i) {
4 usleep(500*1000);
7 function main($num) {
8 $cmd = file_get_contents("/proc/self/cmdline");
9 $cmd = str_replace("\000", " ", $cmd);
10 $start = microtime(true);
12 echo "Starting $num procs\n";
13 for ($i = 0; $i < $num; $i++) {
14 $handles[] = proc_open($cmd." $i", array(), $pipes);
16 while ($handles) {
17 foreach ($handles as $i => $handle) {
18 $status = proc_get_status($handle);
19 if (!$status['running']) {
20 proc_close($handle);
21 unset($handles[$i]);
25 echo "Done $num procs\n";
26 return microtime(true) - $start;
29 if (count($argv) > 1) {
30 foobar($argv[1]);
31 } else {
32 $x10 = main(10);
33 $x200 = main(200);
34 echo $x10 * 20 < $x200 ? "Failed since $x10 * 20 < $x200" : "Passed", "\n";