diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-05-05 09:11:30 -0500 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-05-05 09:11:30 -0500 |
commit | 49aed6555dbc008c1a378c5cbb303f5467232b6b (patch) | |
tree | 9146cdd7126ead59c57cacbaa04eda0f16761f65 /components/compositing/scrolling.rs | |
parent | 7b87085c1880c60aa3be5b3ec4572a0d93fd5537 (diff) | |
parent | ef8edd4e87aeb3cc71dfd9da2f69437080f5410e (diff) | |
download | servo-49aed6555dbc008c1a378c5cbb303f5467232b6b.tar.gz servo-49aed6555dbc008c1a378c5cbb303f5467232b6b.zip |
Auto merge of #5935 - servo:rustup_2015-04-25, r=Ms2ger
r? everybody
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5935)
<!-- Reviewable:end -->
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, |