| 1234567891011 | import timefrom starlette.middleware.base import BaseHTTPMiddlewareclass HTTPProcessTimeMiddleware(BaseHTTPMiddleware):    async def dispatch(self, request, call_next):        start_time = time.time()        response = await call_next(request)        process_time = time.time() - start_time        response.headers["X-Process-Time"] = str(process_time)        return response
 |