helper method to calculate total response time