rba-sdl2: Trying spin_sleep crate
Former-commit-id: 1c6a36a1a61be3949080a8c86915235aaf25d0e5
This commit is contained in:
parent
31eb12cb6a
commit
38e504515b
|
@ -24,6 +24,7 @@ bitflags = "1.1.0"
|
||||||
zip = "0.5.3"
|
zip = "0.5.3"
|
||||||
ctrlc = "3.1.3"
|
ctrlc = "3.1.3"
|
||||||
cpal="0.10.0"
|
cpal="0.10.0"
|
||||||
|
spin_sleep="0.3.7"
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "rba-sdl2"
|
name = "rba-sdl2"
|
||||||
|
|
|
@ -2,6 +2,8 @@ extern crate sdl2;
|
||||||
use sdl2::event::Event;
|
use sdl2::event::Event;
|
||||||
use sdl2::keyboard::Keycode;
|
use sdl2::keyboard::Keycode;
|
||||||
|
|
||||||
|
extern crate spin_sleep;
|
||||||
|
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
|
|
||||||
|
@ -115,7 +117,7 @@ fn main() {
|
||||||
match delay {
|
match delay {
|
||||||
None => {}
|
None => {}
|
||||||
Some(delay) => {
|
Some(delay) => {
|
||||||
::std::thread::sleep(delay);
|
spin_sleep::sleep(delay);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue