capture time spent in middleware stack