These mileage computers usually are connected to the fuel injection metering system to determine immediate consumption. They can be averaged over varying amounts of time. If there is no averaging, such as on the '06 Grand Vitara, they are little more than a curiosity. If they're averaged over too long a time, you may as well just use the average trip mileage function.
The trip computer on our Spirit averages the immediate readout every 4 seconds.
I'm of the opinion that the fuel injection metering system is very precise, so immediate consumption readouts should start with very accurate information, which is then diluted, but not degraded, by averaging. They also use whatever system the car uses for the odometer, to determine the distance being travelled. I suppose that is subject to a bit of error.
Typical trip/mileage computers also have a reset function and give an average mileage since the last reset. Since this uses the same signals as the immediate mileage calculation, it should also be pretty accurate. The calculation is done and the display updated at different time intervals for different cars. I believe the interval on the Spirit is 18 seconds. So the longer you've been driving, the more slowly the readout changes.
Then there's the DTE - Distance to Empty. If DTE used the fuel injection metering signal, it would somehow have to account for fillups because it has to know how much fuel is in the tank before it begins deducting the fuel being used. Typically DTE is just dumb and uses the same signal/current as the regular old fuel guage. We all know how inaccurate those things are. So you can have 10 litres left and DTE says you are out of fuel.
On our car, DTE is set up this way and is basically useless. The "trip computer" readout also has the time and distance since the last reset.
If anyone knows of cars where DTE is accurate, and how it is done, I'd be interested in an explanation.