fn duration_from_frames(&self, frames: usize) -> fasync::Duration {
        let fps = self.frames_per_second as i64;
        let secs = frames as i64 / fps;
        let leftover_frames = frames as i64 % fps;
        let nanos = (leftover_frames * 1_000_000_000i64) / fps;
        let roundup_nano = if 0 != ((leftover_frames * 1_000_000_000i64) % fps) { 1 } else { 0 };
        secs.seconds() + (nanos + roundup_nano).nanos()
    }
/// Return an amount of time that guarantees that `frames` frames has passed.
/// This means that partial nanoseconds will be rounded up, so that
/// [time, time + duration_from_frames(n)] is guaranteed to include n audio frames.
/// Only defined for positive numbers of frames.
Return an amount of time that guarantees that `frames` frames has passed.
This means that partial nanoseconds will be rounded up, so that
[time, time + duration_from_frames(n)] is guaranteed to include n audio frames.
Only defined for positive numbers of frames.
Return an amount of time that guarantees that ` frames ` frames has passed . This means that partial nanoseconds will be rounded up so that [ time time + duration_from_frames ( n ) ] is guaranteed to include n audio frames . Only defined for positive numbers of frames .
fn duration_from_frames(&self, frames: usize) -> fasync::Duration {
        let fps = self.frames_per_second as i64;
        let secs = frames as i64 / fps;
        let leftover_frames = frames as i64 % fps;
        let nanos = (leftover_frames * 1_000_000_000i64) / fps;
        let roundup_nano = if 0 != ((leftover_frames * 1_000_000_000i64) % fps) { 1 } else { 0 };
        secs.seconds() + (nanos + roundup_nano).nanos()
    }
fn duration_from_frames ( & self , frames : usize ) -> fasync :: Duration { let fps = self . frames_per_second as i64 ; let secs = frames as i64 / fps ; let leftover_frames = frames as i64 % fps ; let nanos = ( leftover_frames * 1_000_000_000i64 ) / fps ; let roundup_nano = if 0 != ( ( leftover_frames * 1_000_000_000i64 ) % fps ) { 1 } else { 0 } ; secs . seconds ( ) + ( nanos + roundup_nano ) . nanos ( ) }
Return an amount of time that guarantees that `frames` frames has passed.
Return an amount of time that guarantees that ` frames ` frames has passed .
&self
frames
usize
&self
frames
usize