From 91230afc44ef84d7e68ac8670afdacf157ba2472 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Thu, 4 Jan 2018 09:32:33 -0800 Subject: [PATCH] fix time calculations --- src/middleware/logger.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/middleware/logger.rs b/src/middleware/logger.rs index ac1d6cc47..f7c008c1c 100644 --- a/src/middleware/logger.rs +++ b/src/middleware/logger.rs @@ -223,7 +223,7 @@ impl FormatText { FormatText::Pid => unsafe{libc::getpid().fmt(fmt)}, FormatText::Time => { let response_time = time::now() - entry_time; - let response_time = (response_time.num_seconds() * 1000) as f64 + + let response_time = response_time.num_seconds() as f64 + (response_time.num_nanoseconds().unwrap_or(0) as f64) / 1000000000.0; fmt.write_fmt(format_args!("{:.6}", response_time))