PHP Class CI_Benchmark, TastyIgniter

This class enables you to mark points and calculate the time difference between them. Memory consumption can also be displayed.
Datei anzeigen Open project: tastyigniter/tastyigniter

Public Properties

Property Type Description
$marker array List of all benchmark markers

Public Methods

Method Description
elapsed_time ( string $point1 = '', string $point2 = '', integer $decimals = 4 ) : string Elapsed time
mark ( string $name ) : void Set a benchmark marker
memory_usage ( ) : string Memory Usage

Method Details

elapsed_time() public method

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.
public elapsed_time ( string $point1 = '', string $point2 = '', integer $decimals = 4 ) : string
$point1 string A particular marked point
$point2 string A particular marked point
$decimals integer Number of decimal places
return string Calculated elapsed time on success, an '{elapsed_string}' if $point1 is empty or an empty string if $point1 is not found.

mark() public method

Multiple calls to this function can be made so that several execution points can be timed.
public mark ( string $name ) : void
$name string Marker name
return void

memory_usage() public method

Simply returns the {memory_usage} marker. 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.
public memory_usage ( ) : string
return string '{memory_usage}'

Property Details

$marker public_oe property

List of all benchmark markers
public array $marker
return array