I had one of these features in my 1998 Volkswagen GTI. It was built into the car's LCD trip computer readout and controlled from one of the stalks on the steering wheel. I miss this feature terribly, I wish all cars had it.

Interestingly, the car's own owner's manual gave me the hint that I needed to figure out how it worked. It gave me a list of all the things that the trip computer recorded, and on the list was the following item:

"Amount of fuel used (Not displayed)."

So it was hooking into the electronic fuel injection system and keeping track of the amount of fuel that got squirted through the injectors since turning on the key. It took the "current trip" distance (a value that was similarly reset when I turned on the key), and did some sort of complicated newfangled high-tech math (I think it's called "division" whatever that is) to give me the MPG readout.

I also had the option to reset the trip counter by hand of course, and when I did this I assume it also reset the fuel consumption counter. I used to amuse myself by resetting it when I would go downhill or uphill, or when I was coasting in neutral, just to see how much difference there really was with various engine loads. Hours of fun.
_________________________
Tony Fabris