Class CI_Benchmark - echiong/testRepo GitHub Wiki

##Class CI_Benchmark

CodeIgniter Benchmark Class

This class enables you to mark points and calculate the time difference between them. Memory consumption can also be displayed.

Package: [[CodeIgniter<a href="Package CodeIgniter.Libraries.md">Libraries]]
Category: Libraries
Author: ExpressionEngine Dev Team
Link: http://codeigniter.com/user_guide/libraries/benchmark.html
Located at system/core/Benchmark.php

##Methods summary


public mark ( string $name )

Set a benchmark marker

Multiple calls to this function can be made so that several execution points can be timed

Parameters

$name string
$name name of the marker


public mixed elapsed_time ( string $point1 = '', string $point2 = '', integer $decimals = 4 )

Calculates the time difference between two marked points.

If the first parameter is empty this function instead returns the {elapsed_time} pseudo-variable. This permits the full system execution time to be shown in a template. The output class will swap the real value for this variable.

Parameters

$point1 string
a particular marked point

$point2 string
a particular marked point

$decimals integer
the number of decimal places

Returns mixed


public string memory_usage ( )

Memory Usage

This function returns the {memory_usage} pseudo-variable. This permits it to be put it anywhere in a template without the memory being calculated until the end. The output class will swap the real value for this variable.

Returns string

<table class="summary" id="properties">
<caption>Properties summary</caption>
<tr data-order="marker" id="$marker">
	<td class="attributes"><code>
		public  
		array
	</code></td>

	<td class="name">

$marker

array()
#
		<div class="description detailed">

List of all benchmark markers and when they were added

		</div>
	</div></td>
</tr>
</table>
⚠️ **GitHub.com Fallback** ⚠️