\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.

Summary

Methods
Properties
Constants
mark()
elapsed_time()
memory_usage()
$marker
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$marker

$marker : array

List of all benchmark markers and when they were added

Type

array

Methods

mark()

mark(string  $name) : void

Set a benchmark marker

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

Parameters

string $name

name of the marker

elapsed_time()

elapsed_time(  $point1 = '',   $point2 = '',   $decimals = 4) : mixed

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
$point2
$decimals

Returns

mixed

memory_usage()

memory_usage() : string

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