Skip to content

Commit

Permalink
缩短循环间隔
Browse files Browse the repository at this point in the history
  • Loading branch information
shadow3aaa committed Mar 2, 2024
1 parent 9ac07e3 commit fd8c2c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/framework/scheduler/looper/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ impl Looper {
}

fn recv_message(&mut self, target_fps: Option<u32>) -> Result<Option<BinderMessage>> {
let timeout = target_fps.map_or(Duration::from_secs(1), |t| Duration::from_secs(2) / t);
let timeout = target_fps.map_or(Duration::from_secs(1), |t| Duration::from_secs(1) / t);

match self.rx.recv_timeout(timeout) {
Ok(m) => Ok(Some(m)),
Expand Down
4 changes: 2 additions & 2 deletions src/framework/scheduler/looper/policy/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ impl Buffer {
fn frame_analyze(&mut self, policy_data: PolicyData) -> NormalEvent {
self.acc_frame.acc(policy_data.normalized_unit_frame);

if self.acc_timer.elapsed() * policy_data.target_fps < Duration::from_secs(1) {
/* if self.acc_timer.elapsed() * policy_data.target_fps < Duration::from_secs(1) {
return NormalEvent::None;
}
} */

self.acc_timer = Instant::now();

Expand Down

0 comments on commit fd8c2c6

Please sign in to comment.