Welcome Guest, Not a member yet? Register   Sign In
Benchmark mark - converting from CI3 to CI4
#1

Hello,
I'm converting a large project from CI3 to CI4.  I have the following lines that needs to be converted: 
Code:
$this->benchmark->mark('getProjectMethods_start');
//code in between
$this->benchmark->mark('getProjectMethods_end');

I don't see an equivalent function to 'mark' in the CI4 documentation on benchmarking https://codeigniter4.github.io/CodeIgnit...hmark.html
How would I do this in CI4? Do I just use start and end with the same name, something like: 
Code:
$benchmark = service('timer');
$benchmark->start('getProjectMethods');
//code in between
$benchmark->end('getProjectMethods');
Reply
#2

(This post was last modified: 10-01-2024, 09:33 PM by InsiteFX.)

CodeIgniter 4 User Guide - Testing Benchmarking

I think you would use benchmarking->record();
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

(10-01-2024, 12:07 PM)xanabobana Wrote: How would I do this in CI4? Do I just use start and end with the same name, something like: 
Code:
$benchmark = service('timer');
$benchmark->start('getProjectMethods');
//code in between
$benchmark->end('getProjectMethods');

Yes.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB