note 87215 added to ref.outcontrol
| From: | della at sun dot com | Date: | Tue, 25 Nov 2008 09:08:37 +0000 |
| Subject: | note 87215 added to ref.outcontrol | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-146901@lists.php.net to get a copy of this message | ||
Sometimes users are blaming about slow pages ... not being aware that mostly this is due to network
issues.
So I've decided to add some statistics at the end of my pages:
At beginning I start the counters:
function microtime_float() {
if (version_compare(PHP_VERSION, '5.0.0', '>')) return microtime(true);
list($u,$s)=explode(' ',microtime()); return ((float)$u+(float)$s);
}
$initime=microtime_float();
ob_start();
ob_implicit_flush();
And at the end I show the statistics:
echo "PHP Time: ".round((microtime_float()-$initime)*1000)." msecs. ";
echo "Size: ".round_byte(strlen(ob_get_contents()));
ob_end_flush();
(round_byte is my function to print byte sizes)
----
Server IP: 208.69.120.35
Probable Submitter: 192.9.112.196
----
Manual Page -- http://www.php.net/manual/en/ref.outcontrol.php
Edit -- https://master.php.net/note/edit/87215
Del: integrated -- https://master.php.net/note/delete/87215/integrated
Del: useless -- https://master.php.net/note/delete/87215/useless
Del: bad code -- https://master.php.net/note/delete/87215/bad+code
Del: spam -- https://master.php.net/note/delete/87215/spam
Del: non-english -- https://master.php.net/note/delete/87215/non-english
Del: in docs -- https://master.php.net/note/delete/87215/in+docs
Del: other reasons-- https://master.php.net/note/delete/87215
Reject -- https://master.php.net/note/reject/87215
Search -- https://master.php.net/manage/user-notes.php