How do devices which measure energy consumed work? For example the ones in solar regulators/chargers which display how many Ah went into the battery and how many went out?
Do they just measure the current for example every second and a microprocessor constantly adds up the measurements, assuming that the current 0.5s before and after each measurement is the same as while they take the current measurement, or do they have a way of really measuring how much energy went through, without referring to such, possibly inaccurate approximation?