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;
use iced::time::{self, milliseconds};
use iced::widget::canvas::{stroke, Cache, Geometry, LineCap, Path, Stroke};
use iced::widget::{canvas, container};
use iced::{alignment, Radians};
@ -49,7 +49,7 @@ impl Clock {
}
fn subscription(&self) -> Subscription<Message> {
time::every(time::Duration::from_millis(500))
time::every(milliseconds(500))
.map(|_| Message::Tick(chrono::offset::Local::now()))
}