Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use std::time::Duration for time intervals #7616

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Prev Previous commit
Next Next commit
fix review point
  • Loading branch information
higumachan authored and kmeisthax committed Nov 30, 2022
commit 5b2872566152e453bdfa0efbcb1b4c7461426939
4 changes: 2 additions & 2 deletions tests/tests/regression_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1387,7 +1387,7 @@ fn run_swf(
let base_path = Path::new(swf_path).parent().unwrap();
let mut executor = NullExecutor::new();
let movie = SwfMovie::from_path(swf_path, None)?;
let frame_time = Duration::from_millis(1000.0 / movie.frame_rate().to_f64());
let frame_time = Duration::from_secs(1.0 / movie.frame_rate().to_f64());
let trace_output = Rc::new(RefCell::new(Vec::new()));

#[allow(unused_mut)]
Expand Down Expand Up @@ -1447,7 +1447,7 @@ fn run_swf(
// with timer execution (timers will see an elapsed time of *at least*
// the requested timer interval).
if frame_time_sleep {
std::thread::sleep(StdDuration::from_nanos(frame_time.as_nanos() as u64));
std::thread::sleep(frame_time.into());
}

while !player
Expand Down