mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-24 16:02:59 +01:00
fix time calculations
This commit is contained in:
parent
afeffe4b19
commit
91230afc44
@ -223,7 +223,7 @@ impl FormatText {
|
|||||||
FormatText::Pid => unsafe{libc::getpid().fmt(fmt)},
|
FormatText::Pid => unsafe{libc::getpid().fmt(fmt)},
|
||||||
FormatText::Time => {
|
FormatText::Time => {
|
||||||
let response_time = time::now() - entry_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;
|
(response_time.num_nanoseconds().unwrap_or(0) as f64) / 1000000000.0;
|
||||||
|
|
||||||
fmt.write_fmt(format_args!("{:.6}", response_time))
|
fmt.write_fmt(format_args!("{:.6}", response_time))
|
||||||
|
Loading…
Reference in New Issue
Block a user