1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
//! Listen and react to time.
use crate::Subscription;

/// Returns a [`Subscription`] that produces messages at a set interval.
///
/// The first message is produced after a `duration`, and then continues to
/// produce more messages every `duration` after that.
///
/// [`Subscription`]: ../subscription/struct.Subscription.html
pub fn every(
    duration: std::time::Duration,
) -> Subscription<std::time::Instant> {
    iced_futures::time::every(duration)
}