diff --git a/Cargo.toml b/Cargo.toml index 2cb4e62..de909e3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,6 +24,7 @@ bitflags = "1.1.0" zip = "0.5.3" ctrlc = "3.1.3" cpal="0.10.0" +spin_sleep="0.3.7" [[bin]] name = "rba-sdl2" diff --git a/src/plat/sdl2/main.rs b/src/plat/sdl2/main.rs index fc77714..547ffa3 100644 --- a/src/plat/sdl2/main.rs +++ b/src/plat/sdl2/main.rs @@ -2,6 +2,8 @@ extern crate sdl2; use sdl2::event::Event; use sdl2::keyboard::Keycode; +extern crate spin_sleep; + use std::cell::RefCell; use std::rc::Rc; @@ -115,7 +117,7 @@ fn main() { match delay { None => {} Some(delay) => { - ::std::thread::sleep(delay); + spin_sleep::sleep(delay); } }; }