Measuring mean values of current or voltage during a given time interval