Skip to content
WJunction - Webmaster Forum

Checking Uptime / Loading Speed

Status
Not open for further replies.

{Psycho}

Established Member
241
2010
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.

About the author

P
Established Member · Joined
241
Messages
0
Reactions
16
Points
Grow your business

Advertise on WJunction

Connect with an established international community of webmasters, hosting providers, developers and online entrepreneurs.

  • Premium & Premium+ Sticky
  • Dedicated section banners
  • Site-wide banner advertising
Explore advertising options
Back
Top Bottom