|
|
|
|
![]() ![]() |
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 ©2005 - YOURNAME<br />Script executed in '.round($end_time-$start_time,5).' seconds.'; } |
|
|
|
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??
|
|
|
|
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.
|
|
|
|
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.
|
|
|
|
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 |
|
|
|
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.
|
|
|
|
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. |
|
|
|
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. >_> |
|
|
|
![]() ![]() |
Similar Topics