How is the average amperage calculated within the Current Sensor?

It must take a sampling of measurements and then calculate the peak and average