| | Submitted on: 6/25/2002 1:45:26 PM
By: Steve Gricci
Level: Beginner User Rating:
By 7 Users Compatibility:PHP 3.0, PHP 4.0
Users have accessed this article 4371 times. | (About the author) |
| | This small script will let you output how much time (in seconds) it took for the page to expell. i.e. 0.501 seconds | |
|
Terms of Agreement:
By using this article, you agree to the following terms...
1) You may use
this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
2) You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.
3) You may link to this article from another website, but ONLY if it is not wrapped in a frame.
4) You will abide by any additional copyright restrictions which the author may have placed in the article or article's description. | /*
*@author steve gricci
*@access public
*@skill beginner
*@site www.deepcode.net
*/
//put at begining of file
function utime (){
$time = explode( " ", microtime());
$usec = (double)$time[0];
$sec = (double)$time[1];
return $sec + $usec;
}
$start = utime();
//put at end of page before /body and /h
// tml tags
$end = utime(); $run = $end - $start; echo "Page expelled in " . substr($run, 0, 5) . " secs.";
//Nothing after this | |
Other 1 submission(s) by this author
|
|
|
Report Bad Submission |
|
|
Your Vote! |
See Voting Log |
|
Other User Comments |
6/30/2002 12:39:11 AM:Steve Gricci if anyone wouldn't mind, please vote on
this code for me :)
|
7/3/2002 9:12:08 AM:Sue Great code. small and to the point.
Just what I was looking for. Thanks.
|
8/1/2002 12:27:46 PM:Derrick Simpson Well, It does a great job of telling
how long the server took to process the
php, but that has nothing to do with
browser rendering time or bandwidth. In
fact, you should get almost the very
same number regardless of the
browser.
The PHP Hypertext
Preprocessor generates the html and
then the browser loads the page.
|
9/21/2002 11:54:01 PM: I agree with Derrick, it had nothing to
do with the browser loading time.
|
|
Add Your Feedback! |
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.
NOTICE: The author of this article has been kind enough to share it with you. If you have a criticism, please state it politely or it will be deleted.
For feedback not related to this particular article, please click here. |
|