class Rack::Runtime

Sets an “x-runtime” response header, indicating the response time of the request, in seconds

You can put it right before the application to see the processing time, or before all the other middlewares to include time for them, too.