Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-26-2003, 06:15 AM   PM User | #1
raptori
New Coder

 
Join Date: Nov 2002
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
raptori is an unknown quantity at this point
help with the "page creation time"

im trying to figureout what method is faster while i make the scripts.
to do that i need to know how long it took to complete the script.
can anyone tell me how to do that?

thx in advanced.
raptori is offline   Reply With Quote
Old 01-26-2003, 04:29 PM   PM User | #2
brothercake
Senior Coder


 
Join Date: Jun 2002
Location: near Oswestry
Posts: 4,508
Thanks: 0
Thanked 0 Times in 0 Posts
brothercake is an unknown quantity at this point
I've got a thing that times how long a page takes to load, from request to completion; it's a broad knife but it should show you if x feature makes a big difference - http://www.brothercake.com/scripts/loadtimer.php
brothercake is offline   Reply With Quote
Old 01-26-2003, 10:01 PM   PM User | #3
raptori
New Coder

 
Join Date: Nov 2002
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
raptori is an unknown quantity at this point
here it is

PHP Code:
<?php
//script by Afrim S. <afrimi22@yahoo.com>


//loading time function
$time_start getmicrotime();

function 
getmicrotime(){ 
    list(
$usec$sec) = explode(" ",microtime()); 
    return ((float)
$usec + (float)$sec); 
    } 
//end of loading time function


//YOUR CODE GOES HERE




//final code for Loading time.  DO NOT DELETE
$time_end getmicrotime();
$time $time_end $time_start;
echo 
"Page generated in ".number_format($time,4)." seconds";


?>
brothercake, thanks for that link.
raptori is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:21 PM.


Advertisement
Log in to turn off these ads.