Loading of the server on the page output

June 27, 2009, Posted by admin at 6:00 am

Here is how you explained with the loading of your PHP page on the server on your Page can spend.

Following PHP code grabs her at the top of the page when the loading is to be measured:

<? php
$ mtime = microtime ();
$ mtime = explode ( “”, $ mtime);
$ mtime = $ mtime [1] + $ mtime [0];
$ time1 = $ mtime;
?>

Then comes the content of the page, with everything that is spent, and at the very bottom of the page again the following code:

<? php
$ mtime = microtime ();
$ mtime = explode ( “”, $ mtime);
$ mtime = $ mtime [1] + $ mtime [0];
$ time2 = $ mtime;
$ loadtime = ($ time2 - $ time1);
$ loadtime = round ($ loadtime, 4);
echo $ loadtime;
?>

This is at the bottom of the page now something like 0.2598 sec output.
Just load the page on the server …
The transfer to the user is measured but not yet! This still needs to be added.

No comment yet.

You must be logged in to post a comment.