Checking Uptime / Loading Speed

Status
Not open for further replies.

{Psycho}

Active Member
241
2010
0
0
Is there anyway to check how much time a site takes to load completely

Also is that load time normal / slow / fast / perfect ??

Anything anyone know please help
 
8 comments
PHP:
<?php

// Paste this in header before HTML starts.
$time = microtime();
$time = explode(" ", $time);
$time = $time[1] + $time[0];
$start = $time;

// Paste this on end of page/html.
$time = microtime();
$time = explode(" ", $time);
$time = $time[1] + $time[0];
$finish = $time;
$totaltime = ($finish - $start);
printf ("Load time: %f seconds", $totaltime);

?>
 
A thankyou would be nice next time. I don't know.

This is one of the reasons that most Respected Developers stopped providing help.
 
Last edited:
So many respected developers >.>
eIhaIE.png
 
@ l0calh0st

Hey Thx mate for helping much much appreciated for the help :)

@NightLightW

Yes it works everywhere where php works
 
Last edited:
PHP:
<?php

// Paste this in header before HTML starts.
$time = microtime();
$time = explode(" ", $time);
$time = $time[1] + $time[0];
$start = $time;

// Paste this on end of page/html.
$time = microtime();
$time = explode(" ", $time);
$time = $time[1] + $time[0];
$finish = $time;
$totaltime = ($finish - $start);
printf ("Load time: %f seconds", $totaltime);

?>

BTW Since PHP 5 we can get a float value using the get_as_float parameter. So it can be very simple like:-
PHP:
<?php

// Paste this in header before HTML starts.
$start = microtime(1);

// Paste this on end of page/html.
printf ("Load time: %f seconds", microtime(1) - $start);

?>
Thats why they are thinking to make it return float value by default in PHP6 :p
 
Status
Not open for further replies.
Back
Top