Jump to content
xisto Community
Sign in to follow this  
Jesse

Time Generation Code

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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/

Edited by BuffaloHELP (see edit history)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

>_< 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..

Share this post


Link to post
Share on other sites

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.";?>

Share this post


Link to post
Share on other sites

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;?>

Share this post


Link to post
Share on other sites

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 ...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.