LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   php restrictions??? (https://www.linuxquestions.org/questions/linux-general-1/php-restrictions-90401/)

pk21 09-08-2003 02:25 AM

php restrictions???
 
Hi all,

I have a php script for benchmarking my cpu. The problem is that the script says it is a 900mHz processor, but it actually is a 2.2 gHz.

Is there a restriction somewhere in php or apache that can cause the script not to run at 100 %???

pk21 09-08-2003 08:21 AM

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>

pk21 09-08-2003 08:23 AM

Ok, doesn't look that great :D
Please check: http://www.planet-source-code.com/vb...d=484&lngWId=8


All times are GMT -5. The time now is 12:24 PM.