pub(crate) fn abs_timespec_from_duration(d: Duration) -> timespec {
    unsafe {
        #[allow(clippy::uninit_assumed_init)]
        let mut cur_time: timespec = MaybeUninit::uninit().assume_init();
        // Get current time
        clock_gettime(CLOCK_REALTIME, &mut cur_time);
        // Add duration
        cur_time.tv_sec += d.as_secs() as nix::sys::time::time_t;
        cur_time.tv_nsec += d.subsec_nanos() as nix::sys::time::time_t;
        cur_time
    }
}
/// Adds a duration to the current time
Adds a duration to the current time
Adds a duration to the current time
pub(crate) fn abs_timespec_from_duration(d: Duration) -> timespec {
    unsafe {
        #[allow(clippy::uninit_assumed_init)]
        let mut cur_time: timespec = MaybeUninit::uninit().assume_init();
        // Get current time
        clock_gettime(CLOCK_REALTIME, &mut cur_time);
        // Add duration
        cur_time.tv_sec += d.as_secs() as nix::sys::time::time_t;
        cur_time.tv_nsec += d.subsec_nanos() as nix::sys::time::time_t;
        cur_time
    }
}
pub ( crate ) fn abs_timespec_from_duration ( d : Duration ) -> timespec { unsafe { # [ allow ( clippy uninit_assumed_init ) ] let mut cur_time : timespec = MaybeUninit :: uninit ( ) . assume_init ( ) ; // Get current time clock_gettime ( CLOCK_REALTIME , & mut cur_time ) ; // Add duration cur_time . tv_sec += d . as_secs ( ) as nix :: sys :: time :: time_t ; cur_time . tv_nsec += d . subsec_nanos ( ) as nix :: sys :: time :: time_t ; cur_time } }
Adds a duration to the current time
Adds a duration to the current time
d
Duration
d
Duration