pub fn time_till_next_job(&self) -> std::time::Duration {
        if self.jobs.is_empty() {
            // Take a guess if there are no jobs.
            return std::time::Duration::from_millis(500);
        }
        let mut duration = Duration::zero();
        let now = Utc::now();
        for job in self.jobs.iter() {
            for event in job.schedule.upcoming(offset::Utc).take(1) {
                let d = event - now;
                if duration.is_zero() || d < duration {
                    duration = d;
                }
            }
        }
        duration.to_std().unwrap()
    }
/// The `time_till_next_job` method returns the duration till the next job
/// is supposed to run. This can be used to sleep until then without waking
/// up at a fixed interval.AsMut
///
/// ```rust, ignore
/// loop {
///     sched.tick();
///     std::thread::sleep(sched.time_till_next_job());
/// }
/// ```
The `time_till_next_job` method returns the duration till the next job
is supposed to run. This can be used to sleep until then without waking
up at a fixed interval.AsMut


The ` time_till_next_job ` method returns the duration till the next job is supposed to run . This can be used to sleep until then without waking up at a fixed interval . AsMut
pub fn time_till_next_job(&self) -> std::time::Duration {
        if self.jobs.is_empty() {
            // Take a guess if there are no jobs.
            return std::time::Duration::from_millis(500);
        }
        let mut duration = Duration::zero();
        let now = Utc::now();
        for job in self.jobs.iter() {
            for event in job.schedule.upcoming(offset::Utc).take(1) {
                let d = event - now;
                if duration.is_zero() || d < duration {
                    duration = d;
                }
            }
        }
        duration.to_std().unwrap()
    }
pub fn time_till_next_job ( & self ) -> std :: time :: Duration { if self . jobs . is_empty ( ) { // Take a guess if there are no jobs. return std :: time :: Duration :: from_millis ( 500 ) ; } let mut duration = Duration :: zero ( ) ; let now = Utc :: now ( ) ; for job in self . jobs . iter ( ) { for event in job . schedule . upcoming ( offset :: Utc ) . take ( 1 ) { let d = event - now ; if duration . is_zero ( ) || d < duration { duration = d ; } } } duration . to_std ( ) . unwrap ( ) }
The `time_till_next_job` method returns the duration till the next job
is supposed to run.
The ` time_till_next_job ` method returns the duration till the next job is supposed to run .
&self
&self