Jump to content

How much time it takes to send a single email


mohammed.yahya

Recommended Posts

Hi thorpe

 

I do not know much in PHP. I do not know how to measure it using the code. I need an accurate number in milliseconds or second.

 

I tried to send an email and I feeled how much it took...but I need to know exact and accurate number in milliseconds.

 

thanks a lot

<?php
$time = microtime();

$to = '*YOUR EMAIL ADDRESS*';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: [email protected]' . "\r\n" .
    'Reply-To: [email protected]' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);

echo $time - microtime();

?>

 

That'll give you the time it takes to do 1 in microseconds. Then multiply it by 1000.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.