Connect middleware to calculate response times.