CodeIgniter has a Benchmarking class that is always active, enabling the time difference between any two marked points to be calculated.
If you want to measure time difference between two points, you simply add the following code:
$this->benchmark->mark('code_start');
// Some code happens here
$this->benchmark->mark('code_end');
echo $this->benchmark->elapsed_time('code_start', 'code_end');
But what result function elapsed_time
is returning, seconds, milliseconds or some other unit?