0

سورس php

 
naserm
naserm
کاربر طلایی1
تاریخ عضویت : فروردین 1387 
تعداد پست ها : 168
محل سکونت : اصفهان

::
دوشنبه 23 دی 1387  5:41 PM

CPU Speed Test


کد:
<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>
با اجرای برنامه بالا سرعت cpu داده می شود. یادم نیست از کجا دانلود کردم. و نمی دانم چقدر سندیت دارد مبنای کارش. روی یک هاست که اجرا کردم 17 هزار داد.
تشکرات از این پست
دسترسی سریع به انجمن ها