You are here

protected function Mailer::startTimer in Simplenews 8

Same name and namespace in other branches
  1. 8.2 src/Mail/Mailer.php \Drupal\simplenews\Mail\Mailer::startTimer()
  2. 3.x src/Mail/Mailer.php \Drupal\simplenews\Mail\Mailer::startTimer()

Starts the execution timer.

1 call to Mailer::startTimer()
Mailer::sendSpool in src/Mail/Mailer.php
Send simplenews newsletters from the spool.

File

src/Mail/Mailer.php, line 493

Class

Mailer
Default Mailer.

Namespace

Drupal\simplenews\Mail

Code

protected function startTimer() {

  // Windows systems don't implement getrusage(). There is no alternative.
  if (!function_exists('getrusage')) {
    return;
  }
  $usage = getrusage();
  $this->startTime = (double) ($usage['ru_stime.tv_sec'] . '.' . $usage['ru_stime.tv_usec']) + (double) ($usage['ru_utime.tv_sec'] . '.' . $usage['ru_utime.tv_usec']);
}