You are here

public function StopwatchEvent::getMemory in Devel 4.x

Same name and namespace in other branches
  1. 8.3 webprofiler/src/Stopwatch.php \Drupal\webprofiler\StopwatchEvent::getMemory()
  2. 8 webprofiler/src/Stopwatch.php \Drupal\webprofiler\StopwatchEvent::getMemory()
  3. 8.2 webprofiler/src/Stopwatch.php \Drupal\webprofiler\StopwatchEvent::getMemory()

Gets the max memory usage of all periods.

Return value

int The memory usage (in bytes).

File

webprofiler/src/Stopwatch.php, line 502

Class

StopwatchEvent
Class StopwatchEvent.

Namespace

Drupal\webprofiler

Code

public function getMemory() {
  $memory = 0;
  foreach ($this->periods as $period) {
    if ($period
      ->getMemory() > $memory) {
      $memory = $period
        ->getMemory();
    }
  }
  return $memory;
}