mirror of
https://github.com/pinnacle-comp/pinnacle.git
synced 2024-12-25 09:59:21 +01:00
Use Instant::elapsed
This commit is contained in:
parent
4e95a28ddb
commit
7ae7a423dc
2 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue