Add Duration helpers to time module

This commit is contained in:
Héctor Ramón Jiménez 2025-01-24 18:47:34 +01:00
parent 3a07c631ad
commit 3d893ae01b
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
8 changed files with 40 additions and 19 deletions

View file

@ -1,5 +1,5 @@
use iced::mouse;
use iced::time::{self, Instant};
use iced::time::{self, milliseconds, Instant};
use iced::widget::canvas;
use iced::{
Color, Element, Fill, Font, Point, Rectangle, Renderer, Subscription, Theme,
@ -40,7 +40,7 @@ impl TheMatrix {
}
fn subscription(&self) -> Subscription<Message> {
time::every(std::time::Duration::from_millis(50)).map(Message::Tick)
time::every(milliseconds(50)).map(Message::Tick)
}
}