pub fn stats_to_string(&self) -> String {
        let time_since_start = fasync::Time::now().into_zx() - self.start_time;
        let average_frame_time =
            (time_since_start.into_nanos() as f64) / (self.total_presented.get() as f64);
        let average_fps = zx::Duration::from_seconds(1).into_nanos() as f64 / average_frame_time;
        let average_latency =
            (self.total_latency.get().into_millis() as f64) / (self.total_presented.get() as f64);

        format!(
            "Frame Scheduling stats:
           Total produced frames: {}
           Total presented: {} ({:.2}%)
           Total dropped: {} ({:.2}%)
           Total delayed: {} ({:.2}%)
           Total missed latch points: {} ({:.2}%)
           Average latency: {:.2} ms
           Average frame rate: {:.2} fps",
            self.total_produced.get(),
            self.total_presented.get(),
            100.0 * (self.total_presented.get() as f64) / (self.total_produced.get() as f64),
            self.total_dropped.get(),
            100.0 * (self.total_dropped.get() as f64) / (self.total_produced.get() as f64),
            self.total_delayed.get(),
            100.0 * (self.total_delayed.get() as f64) / (self.total_produced.get() as f64),
            self.total_missed_latch_points.get(),
            100.0 * (self.total_missed_latch_points.get() as f64)
                / (self.total_produced.get() as f64),
            average_latency,
            average_fps,
        )
    }
// Returns the stats as a string. Example output:
// Frame Scheduling stats:
//        Total produced frames: 6994
//        Total presented: 6994 (100.00%)
//        Total dropped: 0 (0.00%)
//        Total delayed: 2 (0.03%)
//        Total missed latch points: 2 (0.03%)
//        Average latency: 30.58 ms
//        Average frame rate: 59.83 fps
Returns the stats as a string.
Returns the stats as a string .
pub fn stats_to_string(&self) -> String {
        let time_since_start = fasync::Time::now().into_zx() - self.start_time;
        let average_frame_time =
            (time_since_start.into_nanos() as f64) / (self.total_presented.get() as f64);
        let average_fps = zx::Duration::from_seconds(1).into_nanos() as f64 / average_frame_time;
        let average_latency =
            (self.total_latency.get().into_millis() as f64) / (self.total_presented.get() as f64);
        format!(
            "Frame Scheduling stats:
           Total produced frames: {}
           Total presented: {} ({:.2}%)
           Total dropped: {} ({:.2}%)
           Total delayed: {} ({:.2}%)
           Total missed latch points: {} ({:.2}%)
           Average latency: {:.2} ms
           Average frame rate: {:.2} fps",
            self.total_produced.get(),
            self.total_presented.get(),
            100.0 * (self.total_presented.get() as f64) / (self.total_produced.get() as f64),
            self.total_dropped.get(),
            100.0 * (self.total_dropped.get() as f64) / (self.total_produced.get() as f64),
            self.total_delayed.get(),
            100.0 * (self.total_delayed.get() as f64) / (self.total_produced.get() as f64),
            self.total_missed_latch_points.get(),
            100.0 * (self.total_missed_latch_points.get() as f64)
                / (self.total_produced.get() as f64),
            average_latency,
            average_fps,
        )
    }
pub fn stats_to_string ( & self ) -> String { let time_since_start = fasync :: Time :: now ( ) . into_zx ( ) - self . start_time ; let average_frame_time = ( time_since_start . into_nanos ( ) as f64 ) / ( self . total_presented . get ( ) as f64 ) ; let average_fps = zx :: Duration :: from_seconds ( 1 ) . into_nanos ( ) as f64 / average_frame_time ; let average_latency = ( self . total_latency . get ( ) . into_millis ( ) as f64 ) / ( self . total_presented . get ( ) as f64 ) ; format ! ( " " self total_produced get ( ) self total_presented get ( ) 100.0 ( self total_presented get ( ) as f64 ) ( self total_produced get ( ) as f64 ) self total_dropped get ( ) 100.0 ( self total_dropped get ( ) as f64 ) ( self total_produced get ( ) as f64 ) self total_delayed get ( ) 100.0 ( self total_delayed get ( ) as f64 ) ( self total_produced get ( ) as f64 ) self total_missed_latch_points get ( ) 100.0 ( self total_missed_latch_points get ( ) as f64 ) ( self total_produced get ( ) as f64 ) average_latency average_fps ) }
Returns the stats as a string.
Returns the stats as a string .
&self
&self