menu

Codeigniter Benchmarking Class Library


Codeigniter Benchmarking Class library – Codeigniter benchmarking class library provide various functions that are used for enables the time and memory consumption between two marked points. This library is always active and it is also automatically loaded by CodeIgniter. Here in this tutorial, we are going to explain how to use benchmarking class library.


Codeigniter Benchmarking Class library Example

This library is automatically loaded in codeIgniter.

Functions:-

There are two functions available in benchmarking class library. Now we will explain one by one with example.

  • 1. Total time execution
  • 2. Total memory consumption

1. Total time execution

Syntax of total time execution function is

Syntax of total time execution function is:-

It has some classes:

  • 1. Mark a start point
  • 2. Mark a end point
  • 3. Run the “time consumption” function to view the results

This function calculates and displays the execution time of program.

EXAMPLE

Here is simple example of total time execution.

Total time execution in codeigniter example:-

The output will be like this –

Codeigniter Benchmarking Class library

2. Total memory consumption

Syntax of total memory consumption function is

Syntax of total memory consumption function is:-

It has also same properties.

This Function Calculates and display the memory consumption of program.

EXAMPLE

Here is simple example of total memory consumption.

Total memory consumption in codeigniter example:-

The output will be like this –

Codeigniter Benchmarking Class library

📖 Read More


Advertisements