/// Adds the sample and returns the updated average
Adds the sample and returns the updated average
Adds the sample and returns the updated average
pub fn add_sample(&mut self, sample: usize) -> usize {
        self.samples.push_back(sample);
        self.current_average = self.samples.iter().sum::<usize>() / self.samples.len();
        self.current_average
    }
pub fn add_sample ( & mut self , sample : usize ) -> usize { self . samples . push_back ( sample ) ; self . current_average = self . samples . iter ( ) . sum :: < usize > ( ) / self . samples . len ( ) ; self . current_average }
Adds the sample and returns the updated average
Adds the sample and returns the updated average
&mut self
sample
usize