Setting multiple benchmarks using codeigniter

With the Benchmark Class, you can set multiple benchmarks and calculate the time difference between any of them.

$this->benchmark->mark( 'one' ) ;
// something happens here
$this->benchmark->mark( 'two' ) ;
// something else happens here
$this->benchmark->mark( 'three' ) ;
echo $this->benchmark->elapsed_time('one' ,  'two' ) ;
echo $this->benchmark->elapsed_time('two' , 'three' ) ;
echo $this->benchmark->elapsed_time(' one' , 'three' ) ;

we can retrieve the time between two benchmark points even if there are one or more benchmarks between them.

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.