diff --git a/src/framework/scheduler/looper/policy/pid_controll.rs b/src/framework/scheduler/looper/policy/pid_controll.rs index 6e4fee2c..5afbd520 100644 --- a/src/framework/scheduler/looper/policy/pid_controll.rs +++ b/src/framework/scheduler/looper/policy/pid_controll.rs @@ -47,30 +47,27 @@ pub fn pid_control( let margin = Duration::from_millis(margin); let target = Duration::from_secs(1) + margin; - Some( - pid_control_inner( - pid_params, - frame, - target, - buffer - .frametime_state - .frametimes - .iter() - .copied() - .take(30) - .sum::() - .mul_f64(target_fps), - buffer - .frametime_state - .frametimes - .iter() - .copied() - .take(60) - .sum::() - .mul_f64(target_fps), - ) * 60 - / target_fps as isize, - ) + Some(pid_control_inner( + pid_params, + frame, + target, + buffer + .frametime_state + .frametimes + .iter() + .copied() + .take(30) + .sum::() + .mul_f64(target_fps), + buffer + .frametime_state + .frametimes + .iter() + .copied() + .take(60) + .sum::() + .mul_f64(target_fps), + )) } fn pid_control_inner(