...

View Full Version : help with the "page creation time"



raptori
01-26-2003, 07:15 AM
im trying to figureout what method is faster while i make the scripts.
to do that i need to know how long it took to complete the script.
can anyone tell me how to do that?

thx in advanced.

brothercake
01-26-2003, 05:29 PM
I've got a thing that times how long a page takes to load, from request to completion; it's a broad knife but it should show you if x feature makes a big difference - http://www.brothercake.com/scripts/loadtimer.php

raptori
01-26-2003, 11:01 PM
here it is :D


<?php
//script by Afrim S. <afrimi22@yahoo.com>


//loading time function
$time_start = getmicrotime();

function getmicrotime(){
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
//end of loading time function


//YOUR CODE GOES HERE




//final code for Loading time. DO NOT DELETE
$time_end = getmicrotime();
$time = $time_end - $time_start;
echo "Page generated in ".number_format($time,4)." seconds";


?>
brothercake, thanks for that link.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum