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

@ -4,6 +4,7 @@ use iced::mouse;
use iced::widget::canvas::{
self, stroke, Cache, Canvas, Geometry, Path, Stroke,
};
use iced::window;
use iced::{Element, Fill, Point, Rectangle, Renderer, Subscription, Theme};
pub fn main() -> iced::Result {
@ -34,8 +35,7 @@ impl Arc {
}
fn subscription(&self) -> Subscription<Message> {
iced::time::every(std::time::Duration::from_millis(10))
.map(|_| Message::Tick)
window::frames().map(|_| Message::Tick)
}
}