You are here

public function StopwatchEvent::getMemory in Devel 8.2

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. 4.x webprofiler/src/Stopwatch.php \Drupal\webprofiler\StopwatchEvent::getMemory()

Gets the max memory usage of all periods.

Return value

integer The memory usage (in bytes)

File

webprofiler/src/Stopwatch.php, line 448

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;
}