Limit running time by an ENV variable
parent
17af67535b
commit
1320064fc3
|
@ -31,8 +31,12 @@ function get_primes7($n) {
|
|||
return $res;
|
||||
}
|
||||
|
||||
$startTime = time();
|
||||
$periodTime = getenv('RUN_TIME');
|
||||
|
||||
$res = array();
|
||||
while (1) {
|
||||
|
||||
while ((time() - $startTime) < $periodTime) {
|
||||
$res = get_primes7(10000000);
|
||||
print "Found ".count($res)." prime numbers.\n";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue