Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> About Cragllo's Script Time File., Located on support.trap17.com
Mike
post Apr 10 2005, 09:18 PM
Post #1


Owner of Sub-Zero
********

Group: Members
Posts: 159
Joined: 17-November 04
Member No.: 2,325



It's incorrect.. It gives you a HUGE number with E-5 or something at the end.

Just do this for your file:

CODE

<?php
// At the very top of the document!
$start_time = microtime();


// ...
// ...
// At the very BOTTOM of the document
$end_time = microtime();

// Footer
function footer() {

print 'Copyright &copy;2005 - YOURNAME<br />Script executed in '.round($end_time-$start_time,5).' seconds.';

}

Go to the top of the page
 
+Quote Post
fsastraps
post Apr 10 2005, 10:04 PM
Post #2


Super Member
*********

Group: Members
Posts: 224
Joined: 22-February 05
Member No.: 3,909



Is this script just to tell the user how long the page took to load??
Go to the top of the page
 
+Quote Post
ill
post Apr 10 2005, 10:07 PM
Post #3


Super Member
*********

Group: Members
Posts: 385
Joined: 10-August 04
From: United States
Member No.: 761



yes. something which just takes up your users time to load.. F that script.. it's stupid.
Go to the top of the page
 
+Quote Post
Mike
post Apr 12 2005, 07:36 PM
Post #4


Owner of Sub-Zero
********

Group: Members
Posts: 159
Joined: 17-November 04
Member No.: 2,325



ill, if you think that two-line code that I just posted wastes the users time, then you shouldn't be in the PHP forum because you obviously lack the knowledge of it. It takes no time at all, it shows the time that it takes for the script to execute.
Go to the top of the page
 
+Quote Post
cragllo
post Apr 15 2005, 12:21 PM
Post #5


Privileged Member
*********

Group: Members
Posts: 933
Joined: 24-August 04
Member No.: 892
myCENT:ZERO



All PHP scripts slow down a site, because the script has to be executed first.

Anyhoo, if you know how to fix the script, fix it. I just done it in my spare time.
Have fun tongue.gif
Go to the top of the page
 
+Quote Post
mobious
post Apr 16 2005, 11:11 AM
Post #6


Advanced Member
*******

Group: Members
Posts: 113
Joined: 14-January 05
From: Philippines
Member No.: 3,271



it really has no big effect at all. i mean being slowed down for seconds. at least a fraction of a second ain't bad. coz php scripts, especially those that are really short are parsed fast.
Go to the top of the page
 
+Quote Post
Spectre
post Apr 16 2005, 02:27 PM
Post #7


Privileged Member
*********

Group: Members
Posts: 873
Joined: 30-July 04
Member No.: 246



No offense intended to Cragllo, but none of the scripts provided in the said area are of particularly high quality.

In my opinion, displaying script execution time should be left for benchmarking and testing purposes only; in all seriousness, no one really cares that it took 0.003 seconds for your page to load.
Go to the top of the page
 
+Quote Post
Mike
post Apr 16 2005, 03:44 PM
Post #8


Owner of Sub-Zero
********

Group: Members
Posts: 159
Joined: 17-November 04
Member No.: 2,325



Well cragllo, it is true that the script has to execute but it's just recording the loading time, which basically takes no time at all. Here is a better script thing (again):

CODE

// At the top of the page
$start = array_sum(explode(' ',microtime()));





// At the bottom of the page
$end = array_sum(explode(' ',microtime()));
$domath = $end-$start;
$calc = round($domath,5);

echo 'Executed in <b>'.$calc.'</b> seconds';





Of course, like Spectre said.. Not everybody cares how long it takes for the page to load. But I actually find it kinda interesting, and it lets you know ahead of time is somebody is trying to DDoS you. >_>
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Getting List Of Directories And Files Using Php(6)
  2. Many Php Script Sites(16)
  3. Script: Php Jukebox(6)
  4. Parse: Error Unexpected T_lnumber(4)
  5. Transfer Variables To Another Php Script(9)
  6. Include File.php?id=something(13)
  7. Watermark Your Image With Simple Php Script(35)
  8. Free Auction Script(6)
  9. What Kind Of Script Do You Need ?(15)
  10. Creatting A Playlist Through Php(5)
  11. Very Simple Online Now Script(4)
  12. Html Code Tester. Online Script(15)
  13. Php Downloads Script(4)
  14. Script Help Required: Undefined Variable(3)
  15. Php Rediret Script(12)
  1. Download Script For Mp3 Files(0)
  2. Updating Php File Through A Web Form(5)
  3. How Do I Connect To Live Database With Php Script?(6)
  4. Need Some Help In File Browser(8)
  5. Need Help Installing Dolphin Community Script!(5)
  6. Located Url?(9)
  7. Php Configuration File(16)
  8. Guessing Php Script(2)
  9. How To Make A View New Post Script?(5)
  10. Php Guest Online Script(3)
  11. How To Make Php Newsletter Script(3)
  12. Linux/ Apache /mod_rewrite Issue(4)
  13. Php - Fetching Random Line From A Text File(0)