Home » » Get webpage load time in php

Get webpage load time in php

Written By Unknown on Rabu, 23 November 2011 | 03.11

Hello friends. Want to know the page load time of your webpage. Here is a simple script to findout the page load time.

The code is divided into two blocks. You only have to include these two block of codes into your webpage. First at the top of your page and the second at the bottom of your page.

[ Include following at top of your page ]

$time = microtime();
$time = explode(" ", $time);
$time = $time[1] + $time[0];
$start = $time;

[ Your whole page contents/codes will be placed here ]

[ Include following at bottom of your page ]

$time = microtime();
$time = explode(" ", $time);
$time = $time[1] + $time[0];
$finish = $time;
$totaltime = ($finish - $start);
echo "<!-- ";printf ($totaltime);echo "-->";



Run your page and view source code of your webpage.
You will see the last line commented. It is your page load time.

Thats it. Thanks !!
Share this article :

Posting Komentar

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Kumpulan Kata Broadcast Blackberry - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger