public function MarkdownBenchmarkAverages::getLastBenchmark in Markdown 3.0.x
Retrieves the last benchmark of a certain type.
Parameters
string $type: The type of benchmark to retrieve, can be one of:
- parsed
- rendered
- total (default)
Return value
\Drupal\markdown\MarkdownBenchmark The last benchmark of $type.
File
- src/
MarkdownBenchmarkAverages.php, line 277
Class
- MarkdownBenchmarkAverages
- Class MarkdownBenchmarkAverages.
Namespace
Drupal\markdownCode
public function getLastBenchmark($type = 'total') {
$benchmarks = $this
->getBenchmarks($type);
return array_pop($benchmarks) ?: $this
->getFallbackBenchmark();
}