Here is the script:
//************************************** // for :CPU Tester //************************************** You must leave the Show Source link and HTML Comment with my name and website in it. //************************************** // Name: CPU Tester // Description:You can get a general idea of the CPU speed of your server. I suppose it could also be modified to see about how high of a load you have if you get a benchmark with the server empty. // By: Harlan Iverson // // // Inputs:None // // Returns:None // //Assumes:None // //Side Effects:None //This code is copyrighted and has limited warranties. //Please see
http://www.Planet-Source-Code.com/xq...s/ShowCode.htm //for details. //************************************** <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>