php benchmark 脚本

<?php
$iterations = 12;
$starttime = explode(' ', microtime());
$string1 = 'abcdefghij';
for($j=1;$j<=$iterations;$j++)
{
        for($i = 1; $i <= 20000; $i++)
        {
                $x=$i * 5;
                $x=$x + $x;
                $x=$x/10;
                $string3 = $string1 . strrev($string1);
                $string2 = substr($string1, 9, 1) . substr($string1, 0, 9);
                $string1 = $string2;
        }
}

$endtime = explode(' ', microtime());
$total_time = $endtime[0] + $endtime[1] - ($starttime[1] + $starttime[0]);
$total_time = round($total_time * 1000);
?>
<html><head>
<title>Free PHP Benchmark Performance Script </title>
<meta content="text/html; charset=windows-1252" http-equiv=content-type />
<meta http-equiv="Content-Style-Type" content="text/css" />
</head>
<body>
<h1>Free PHP Benchmark Performance Script</h1>
<?php
echo "<br/>time: $total_time ms <br/>\n";
?><br>
</body></html>

你可能感兴趣的:(windows,PHP,css,脚本,performance)