Top

Loading Time


PHP Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  2.5 (of 2 scores)
Date Added  May 18, 2005
Last Updated  Sep 04, 2008

Introduction

With this script, you simply paste it into which ever *.php file you wish to show it on, and it will then show you how long it took to load that specified page.

Grab the Code

<? 
function getmicrotime(){ 
list($usec, $sec) = explode(" ",microtime()); 
return ((float)$usec + (float)$sec); 
} 
$time_start = getmicrotime(); 
for ($i=0; $i <1000; $i++){ 
} 
$time_end = getmicrotime(); 
$time = $time_end - $time_start; 
$time = round($time,4); 
echo "This page loaded in $time seconds."; 
?> 

Comments

  (1)  RSS
Hawkee
Comments: 1,039
 
PHP Snippet:  Loading Time
Posted on May 25, 2005 4:11 am
You need to clean this up a bit. I suggest using <?php instead of <?. It's too ambiguous. Also, specify where the user should put each piece of code. For example, "Add this code to your header"

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  
Bottom