From 95f5863e7e626efb5d47f71113f5c6e00b117b3b Mon Sep 17 00:00:00 2001 From: theteacat Date: Wed, 7 Feb 2024 10:22:29 +0000 Subject: [PATCH] Fix execution time being integer-only millisecond values --- middlewares/http/middleware.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middlewares/http/middleware.go b/middlewares/http/middleware.go index 6260340..faee073 100644 --- a/middlewares/http/middleware.go +++ b/middlewares/http/middleware.go @@ -188,7 +188,7 @@ func GetMiddleware(options *Options) (func(next http.Handler) http.Handler, erro chainResponseWriter := httptest.NewRecorder() startTime := time.Now() next.ServeHTTP(chainResponseWriter, r) - logEntry.ExecutionTime = float64(time.Since(startTime).Milliseconds()) + logEntry.ExecutionTime = float64(time.Since(startTime)) / 1000000.0 // If it has been enabled, and we were able to determine the route and path params, validate the response against the openapi spec if options.EnableResponseValidation && route != nil && pathParams != nil {