You can benchmark your code by profiling a session. To do this, you can set one breakpoint at the line where you want the counter to start counting and another breakpoint at where to stop.
Select Profiler --> Start New Session… You will see the following dialog:
Type in a name for your profile session and click OK.
A window will appear at the bottom:
To profile a function, you need to add it to the profile session you just created. Double-click on the file you want to do this in, and place the cursor on any line inside the function and right click. Choose Profile Function --> in (session-name) Session.
Execute the code. When the CPU stops, click on the ‘Functions’ tab to see the result of the profiling.