AlabamaHit Posted May 27, 2008 Share Posted May 27, 2008 Ok...I done this on a test game...that im developing..and the time is all wrong...lol.... Let me break it down its on mccode v2 Everypage includes the globals.php. So I figured I would start it there..and put the end on the endpage function which is in everpage...I done this so I would not thave to put it on everypage... This could be why its doing it not sure..but figured Iwould ask here cause there are some good coders here. this is the code I'm using now..Also I ahve used 2 different ones but same result.. Start code I put in my globals. Which is included on everypage at the top with: include "globals.php"; $start = explode(" ", microtime()); $start = $start + $start; Now I put this code in the endpage function in the header.php But it is located at the bottom of everypage with: $h->endpage(); $end = explode(" ", microtime()); $end =$end + $end; $totaltime = ($end - $start); printf("This page took %f seconds to load.",$totaltiem); I did not write this code. I got it from www.corecoding.com So credit for that code goes to them..I say that so no one thinks im trying to take credit for this, lol... But any ideas why that code would give this result: This page took 1211880297.858522 seconds to load. It didnt take that long, lol...but thats the result. EDIT: Here is an update...I have made 2 new pages...startspeed.php and endspeed.php.. If i include them at the top and bottom it works right.... But that would be alot of doing to get that on everypage...anyone have an idea of a faster way that would include in another page already included..Like the ones said already..I have concluded though putting it in a function like that is what gave me that error. Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.