protected function Mailer::getCurrentExecutionTime in Simplenews 8.2
Same name and namespace in other branches
- 8 src/Mail/Mailer.php \Drupal\simplenews\Mail\Mailer::getCurrentExecutionTime()
- 3.x src/Mail/Mailer.php \Drupal\simplenews\Mail\Mailer::getCurrentExecutionTime()
Returns the current execution time.
Return value
float|null The elapsed PHP execution time since the last start.
See also
1 call to Mailer::getCurrentExecutionTime()
- Mailer::sendSpool in src/
Mail/ Mailer.php - Send simplenews newsletters from the spool.
File
- src/
Mail/ Mailer.php, line 512
Class
- Mailer
- Default Mailer.
Namespace
Drupal\simplenews\MailCode
protected function getCurrentExecutionTime() {
// Windows systems don't implement getrusage(). There is no alternative.
if (!function_exists('getrusage')) {
return NULL;
}
$usage = getrusage();
$now = (double) ($usage['ru_stime.tv_sec'] . '.' . $usage['ru_stime.tv_usec']) + (double) ($usage['ru_utime.tv_sec'] . '.' . $usage['ru_utime.tv_usec']);
return $now - $this->startTime;
}