<?PHP
function prepare_random_source()
{
$rtn = '';
for ($i=1; $i<=256; $i++)
{
$rtn .= mt_rand( 0, 9 ).'';
}
return $rtn;
}
$loop = 131072 * 2;
$t1 = time();
while($loop-- > 0)
{
$s1 = prepare_random_source();
$s2 = sha1(md5($s1));
$s3 = crc32($s1.$s2.mt_rand( 0, 1048576 ).'-'.time());
if ($loop % 2)
{
$s4 = mt_rand(1, 255) xor mt_rand(1, 255);
}
}
$t2 = time();
echo $t2 - $t1."\n";
?>
<?PHP
$orig_str="En Taro Adun, Zeratul.";
$str = '';
for ($i=0; $i<=255; $i++)
{
$str .= ($i+1).' '.$orig_str."\n";
}
$loop = 131072 * 8;
$ccnt = 0;
$t1 = time();
while ($loop-- > 0)
{
$b = explode("\n", $str);
$this_str = $b[($loop % 255)];
if (strstr($this_str, '3') || strstr($this_str, '11') || strstr($this_str, '17'))
{
$t = intval(time());
$t = ($t / 127);
$t--;
$c = str_replace('Adun', $t*$t, $this_str);
$ccnt++;
}
}
$t2 = time();
echo $t2 - $t1;
?>