From f6a8aea497d8ec6cda8d12e9857eaacec64e7203 Mon Sep 17 00:00:00 2001 From: Fenrir Date: Fri, 3 Feb 2017 21:22:29 -0700 Subject: [PATCH] fix Instant impl --- ctr-std/src/sys/unix/time.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ctr-std/src/sys/unix/time.rs b/ctr-std/src/sys/unix/time.rs index 9c80560..d28b1f0 100644 --- a/ctr-std/src/sys/unix/time.rs +++ b/ctr-std/src/sys/unix/time.rs @@ -138,8 +138,8 @@ mod inner { let ms = monotonic_ms(); let s = libc::timeval { - tv_sec: ms as i32 * 1_000_000, - tv_usec: ms as i32, + tv_sec: (ms / 1_000_000) as i32, + tv_usec: (ms % 1_000_000) as i32, }; return Instant::from(s) }