...

View Full Version : PHPMailer email taking too much time



achcore
03-25-2009, 03:59 PM
Dear all,
I am using PHPmailer for sending few emails in my page. Now this page is too much time(approximately 45-50 seconds) to redirect to another page after submission. My question is that is there any ways by which i can reduce the loading time of my page. Now as far as sql queries are concerned,they are simple queries like select * from table1 where field1='No' etc and all my tables are indexed. So i think my queries are optimized. Also currently my project is in testing mode and when go live ,i can expect 100-200 emails from page. So please help me in this matter.

steelaz
03-25-2009, 04:18 PM
Try benchmarking your code to see where the delay is. At the beginning use:


$time_start = microtime(1);

Then add checkpoint array at the points you want to measure:



$checkpoint[0] = microtime(1);
$checkpoint[1] = microtime(1);
// etc.


Then at the end show how long they took:



foreach ($checkpoint as $k => $v)
{
$time_elapsed = $v - $time_start;
echo "Checkpoint {$k} reached in {$time_elapsed} seconds <br>";
}

abduraooft
03-25-2009, 04:23 PM
Now as far as sql queries are concerned,they are simple queries like select * from table1 where field1='No' etc and all my tables are indexed. Do you have many queries in loop?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum