Concept Flow - Response time tracking middleware
Request received
Middleware start timer
Pass control to next middleware/handler
Response sent back
Middleware calculates elapsed time
Log or store response time
End
The middleware starts a timer when a request arrives, lets the request process, then calculates and logs the response time after the response is sent.