Script Menghitung Execution Time

Tambahkan fungsi berikut ini di awal script dan panggil langsung fungsi pertamanya.

function getTime(){
		$a = explode (' ',microtime());
		return(double) $a[0] + $a[1];
	} 

function excTime($Start){
		$End = getTime();
		echo "<div style='font-size:11px;color:#6599DD;margin:5px 0;'>this page need ".number_format(($End - $Start),4)." secs too load</div>";
	}

$Start = getTime();

Pada akhir script tulis script berikut

excTime($Start);

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>