pub struct TimeSync { /* private fields */ }Expand description
Maintain a linear mapping between device ticks and host time.
Implementations§
Source§impl TimeSync
impl TimeSync
Sourcepub fn coefficients(&self) -> (f64, f64)
pub fn coefficients(&self) -> (f64, f64)
Return the current slope and intercept of the time mapping.
Sourcepub fn update(&mut self, dev_ts: u64, host_instant: Instant)
pub fn update(&mut self, dev_ts: u64, host_instant: Instant)
Add a new measurement pair to the regression window.
Sourcepub fn to_host_time(&self, dev_ts: u64) -> SystemTime
pub fn to_host_time(&self, dev_ts: u64) -> SystemTime
Convert a device timestamp into a host SystemTime.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TimeSync
impl RefUnwindSafe for TimeSync
impl Send for TimeSync
impl Sync for TimeSync
impl Unpin for TimeSync
impl UnwindSafe for TimeSync
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more