In the old days, this was a pretty simple computation - They actually had "trip computers" in some old cars, and you could buy aftermarket ones and add them to your car pretty cheaply.
On a carburetted car, ALL the fuel that went forward in the fuel line was actually consumed by the engine, so the math was pretty simple.
Fuel injected cars only burn a portion of what the pump sends to the engine, and the rest is returned to the tank by a separate line, so "measuring what goes by" doesn't do you too much good, unless you also carefully measure what comes back.
You can easily calibrate a fuel flow sensor by letting it pump a bunch of gas, and then "telling it" that the amount that flowed by was exactly so many liters/gallons. Harder to do when you have two sensors to deal with, and you have no idea just how much fuel is coming back on the other line.
I'm sure it can be/is being done, but doubt that accurate technology is cheap, so we probably won't see it on Hondas/Mazdas for a while.
Don