Skip to content

Commit

Permalink
Better computer speed slider
Browse files Browse the repository at this point in the history
  • Loading branch information
ArhanChaudhary committed Apr 30, 2024
1 parent df359f3 commit ca2a8c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/builtins/kernel_worker/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub fn try_stop() {
}

pub const ALL_STEPS_PER_LOOP: [usize; 11] =
[1, 10, 50, 200, 500, 2500, 7500, 15000, 22500, 27500, 30000];
[1, 10, 500, 2000, 8000, 15000, 22500, 29250, 29500, 29750, 30000];

pub fn speed(speed_message: SpeedMessage) {
let speed_percentage = speed_message.speed_percentage;
Expand Down
2 changes: 1 addition & 1 deletion src/core/builtins/runtime_worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ pub fn try_start() {
}
if ALL_STEPS_PER_LOOP[ALL_STEPS_PER_LOOP.len() - 1] != steps_per_loop {
thread::sleep(std::time::Duration::from_micros(
(ALL_STEPS_PER_LOOP[ALL_STEPS_PER_LOOP.len() - 1] - steps_per_loop) as u64,
(110000 - 110000 * steps_per_loop / ALL_STEPS_PER_LOOP[ALL_STEPS_PER_LOOP.len() - 1]) as u64,
));
}
if hardware::keyboard(0, false) == 32767 {
Expand Down

0 comments on commit ca2a8c4

Please sign in to comment.