Re: Re: Fsockopen with ssl takes 8.4 seconds to return on Windows
| From: | trystano at aol dot com | Date: | Mon, 06 Mar 2006 10:35:40 +0000 |
| Subject: | Re: Re: Fsockopen with ssl takes 8.4 seconds to return on Windows | ||
| References: | 1 2 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-26744@lists.php.net to get a copy of this message | ||
Thats useful.
Thanks for the nice function! :)
Tryst
-----Original Message-----
From: George Cherian <georgechianrs@gmail.com>
To: trystano@aol.com
Cc: php-windows@lists.php.net <php-windows@lists.php.net>
Sent: Sun, 5 Mar 2006 19:58:32 +0530
Subject: [PHP-WIN] Re: Fsockopen with ssl takes 8.4 seconds to return on Windows
On Sun, Mar 05, 2006 at 06:45:12AM -0500, trystano@aol.com wrote:
Hi George, thanks for informing us of this info. Can I ask how managed to get these times of executing the fsockopen functions?
TrystDo you mean how I managed to profile my code? Or how I actually ran it? For profiling I have a simple function called as print_time dispersed throughout my code. You can just say -------------------- print_time("fsockopen"); fsockopen("..."); print_time("fsockopen", "Fsockopen Took: "); -------------------- print_time('db_read'); sql_query(''); print_time('db_read', "Db read took'); This way you can simply find the time for any two points of the script. I don't know how much overhead the print_time causes, but I don't think that's the issue, since on linux it works fine. Thanks. George function print_time($var, $mess = null, $dbg = 2) { static $last; $now = microtime(true); if (!isset($last[$var])) {
$last[$var] = $now;
return;
}
$diff = round($now - $last[$var], 7);
$now = round($now, 7);
$last[$var] = $now;
if (!$mess) {
return;} print("$mess: $diff <br> \n"); } -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php