store duration instead of end_time (/b/1901200+Mania)

This commit is contained in:
MaxOhn
2024-02-19 15:03:05 +01:00
parent 305041376b
commit f2bb6ce6cb
10 changed files with 39 additions and 33 deletions
+2 -2
View File
@@ -3,9 +3,9 @@ pub struct BananaShower {
}
impl BananaShower {
pub fn new(start_time: f64, end_time: f64) -> Self {
let duration = end_time - start_time;
pub fn new(start_time: f64, duration: f64) -> Self {
let mut spacing = duration;
let end_time = start_time + duration;
while spacing > 100.0 {
spacing /= 2.0;