There are some scientific flowmeters which have been used in the past, however, that was in the day of the carburetor, with no fuel bypass, just a 'one-way' trip.
On EFI, with a common fuel rail, we'd have to measure the 'gross' volume delivered, minus the return-flow volume back to the tank, to calculate the net volume actually consumed.
I believe that modern manufacturing practices are producing fuel injectors of such uniform tolerances that, given sensor technology, and a constant pressure fuel supply, the ECU's pulse-width-modulation data provides for very acceptable mpg data on the fly.
I've compared tank mileage to the readout on the Prius, and I trust the electronics more than my feeble attempts at accounting. And we're talking 2009 technology.