TypePHP 编译器 https://swoole.com/aot/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

17 lines
328 B

<?php
$u = (int)$argv[1];
echo "u: $u\n";
$r = rand(0, 10000);
$a = array_fill(0, 10000, 0);
$begin = microtime(true);
for ($i = 0; $i < 10000; $i++) {
for ($j = 0; $j < 100000; $j++) {
$a[$i] += $j % $u;
}
$a[$i] += $r;
}
echo $a[$r] . "\n";
$end = microtime(true);
echo "sec: " . ($end - $begin) . "\n";