Youāll see that in the pm.info object, thereās a property called as iterationCount which is the total number of iterations that are scheduled to run.
Now,
Total number of iterations === Number of rows in your CSV File
Also, instead of using the response_array.length you can use another property of the pm.info object viz. pm.info.iteration which gives you the current iteration number.
So, to sum it up:
In your test-script you can put the following code snippet:
// Since, pm.info.iteration starts from 0
// Thus, we'll check if iteration === iterationCount - 1
if (pm.info.iteration === pm.info.iterationCount - 1) {
console.log(`response_times are: ${pm.globals.get('response_times')}`);
}