::
دوشنبه 23 دی 1387 5:41 PM
<html>
<head><title>CPU Speed Test</title></head>
<!--Script By Harlan Iverson http://loopy.2y.net-->
<?
if( isset($HTTP_GET_VARS['source']) ){
highlight_file($SCRIPT_FILENAME);
return;
}
$a=0;
//absolutely no code below this line
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$starttime = $mtime;
while($a<100000)
$a++;
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$endtime = $mtime;
$total = $endtime-$starttime;
//okay to put code again
?>
<p>The server machine does 100000 operations in <?= $total ?> Seconds,
the CPU is about <?= (100/$total) ?> MHz.<br><br>
<p>Note: This will not take advantage of multiple CPUs, and is only an
estimated speed. This will change depeding on how busy the server is.
<p><a href="<? $SCRIPT_NAME ?>?source=1">Show Source</a>
</html>