You are here

public function XmlSitemapGenerator::getMemoryUsage in XML sitemap 2.x

Same name and namespace in other branches
  1. 8 src/XmlSitemapGenerator.php \Drupal\xmlsitemap\XmlSitemapGenerator::getMemoryUsage()

Get how much memory was used.

Parameters

bool $start: Start value.

Return value

int Used memory.

Overrides XmlSitemapGeneratorInterface::getMemoryUsage

File

src/XmlSitemapGenerator.php, line 206

Class

XmlSitemapGenerator
XmlSitemap generator service class.

Namespace

Drupal\xmlsitemap

Code

public function getMemoryUsage($start = FALSE) {
  $current = memory_get_peak_usage(TRUE);
  if (!isset(self::$memoryStart) || $start) {
    self::$memoryStart = $current;
  }
  return $current - self::$memoryStart;
}