2

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?

MrD
  • 2,423
  • 3
  • 33
  • 57

1 Answers1

1

it returns a float number represent seconds, "0.654" = 0 sec, and 654 ms. etc

Zalaboza
  • 8,899
  • 16
  • 77
  • 142