diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2015-04-23 00:14:02 +0200 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2015-05-05 10:07:34 -0400 |
commit | ef8edd4e87aeb3cc71dfd9da2f69437080f5410e (patch) | |
tree | 9146cdd7126ead59c57cacbaa04eda0f16761f65 /components/compositing/scrolling.rs | |
parent | 7b87085c1880c60aa3be5b3ec4572a0d93fd5537 (diff) | |
download | servo-ef8edd4e87aeb3cc71dfd9da2f69437080f5410e.tar.gz servo-ef8edd4e87aeb3cc71dfd9da2f69437080f5410e.zip |
Upgrade to rustc 551a74dddd84cf01440ee84148ebd18bc68bd7c8.
Diffstat (limited to 'components/compositing/scrolling.rs')
-rw-r--r-- | components/compositing/scrolling.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/components/compositing/scrolling.rs b/components/compositing/scrolling.rs index 89890fd2b27..11a0b8721f6 100644 --- a/components/compositing/scrolling.rs +++ b/components/compositing/scrolling.rs @@ -6,10 +6,8 @@ use compositor_task::{CompositorProxy, Msg}; -use std::old_io::timer; use std::sync::mpsc::{Receiver, Sender, channel}; -use std::thread::Builder; -use std::time::duration::Duration; +use std::thread::{Builder, sleep_ms}; use time; /// The amount of time in nanoseconds that we give to the painting thread to paint new tiles upon @@ -61,8 +59,8 @@ impl ScrollingTimer { match self.receiver.recv() { Ok(ToScrollingTimerMsg::ScrollEventProcessedMsg(timestamp)) => { let target = timestamp as i64 + TIMEOUT; - let delta = target - (time::precise_time_ns() as i64); - timer::sleep(Duration::nanoseconds(delta)); + let delta_ns = target - (time::precise_time_ns() as i64); + sleep_ms((delta_ns / 1000) as u32); self.compositor_proxy.send(Msg::ScrollTimeout(timestamp)); } Ok(ToScrollingTimerMsg::ExitMsg) | Err(_) => break, |