HOME       >>       Programming

Time Generation Code


Does anyone know the code that I would add into the bottom of my website to have this information show at the very bottom.

Page was generated in 0.009746 seconds!

Thank you for your help.


Are you referring to the actual time that a page was needed to generate information and shown or the time it took for a database to return a result due to a query?

apollo found this: http://forums.xisto.com/topic/32829-page-generation-time-script-a-script-to-tell-how-long-it-took-to-generate/


I am talking about for the page to load and I have looked at that code thaet apollo found and in honesty I do not understand where to put it in my HTML or anything. So some more advice would be really good.'Thanks.


Place the first code right after <HTML>Place the second code wherever you want the time to appear or at the bottom. If you're placing it at the bottom, right before </HTML>Save it as file_name.php And your old file_name.html is no longer needed.Upload and test it out.

Albus Dumbledore

>_< sorry for not putting that in, i suppose it would have helped people who read it to know where to put it..i reported it to a mod and had em change it sorry bout that..


Also, shouldn't this be in another forum? It certainly isn't General Talk.

Albus Dumbledore

might have been, but when BH posted a few days ago he didn't say anything about it, so maybe it is fine here >_<


I use my own "Time generation" php script.
I wrote it more 1 year ago.
It consist of 2 parts:

1st part - need put in top of page

<?//start point of loadinglist($msec,$sec)=explode(chr(32),microtime());$HeadTime=$sec+$msec;//?>

I think that it very nice script!

and 2nd part - need put in bottom of page for displaying
<?//end point of page loadinglist($msec,$sec)=explode(chr(32),microtime());// print generation time with 4 digits after pointecho "Page loading at ".round(($sec+$msec)-$HeadTime,4)." sec.";?>


Here is the code I use:
Add this at the top of the page

<?php$stime=explode(' ', microtime());$stime=$stime[1]+$stime[0];?>
Then at the bottom of the page:
<?php$ftime=explode(' ', microtime());$time=round($ftime[1]+$ftime[0]-$stime, 4);echo 'Execution Time: '.$time;?>


Its Very Easy
So Copy this code And Then paste In Your Soruce File Like Html .... ::

<?php $load = microtime();print (number_format($load,2) . " Seconds.");?>
this code Show And Put time of load in Your page its Easy ...


Xisto.com offers Free Web Hosting to its Members for their participation in this Community. We moderate all content posted here but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use, cookie and privacy policy. Copyright 2001-2019 by Xisto Corporation. All Rights Reserved.