Use Instant::elapsed
Some checks are pending
CI (Pinnacle) / Build (push) Waiting to run
CI (Pinnacle) / Run tests (push) Waiting to run
CI (Pinnacle) / Check formatting (push) Waiting to run
CI (Pinnacle) / Clippy check (push) Waiting to run

This commit is contained in:
Ottatop 2024-06-22 17:19:56 -05:00
parent 4e95a28ddb
commit 7ae7a423dc
2 changed files with 2 additions and 2 deletions

View file

@ -145,7 +145,7 @@ impl CursorState {
return None; return None;
} }
let mut millis = self.start_time.duration_since(Instant::now()).as_millis() as u32; let mut millis = self.start_time.elapsed().as_millis() as u32;
let animation_length_ms = nearest_size_images(self.size, &cursor.images) let animation_length_ms = nearest_size_images(self.size, &cursor.images)
.fold(0, |acc, image| acc + image.delay); .fold(0, |acc, image| acc + image.delay);
millis %= animation_length_ms; millis %= animation_length_ms;

View file

@ -144,7 +144,7 @@ impl LayoutTransaction {
/// Returns whether all pending windows have committed their serials or the timeout has been /// Returns whether all pending windows have committed their serials or the timeout has been
/// reached. /// reached.
pub fn ready(&self) -> bool { pub fn ready(&self) -> bool {
Instant::now().duration_since(self.start_time) >= TIMEOUT self.start_time.elapsed() >= TIMEOUT
|| (!self.wait || (!self.wait
&& self && self
.pending_windows .pending_windows