That's the way Tuason Racing School did it with the Focus... they built a fiberglass rack that's affixed to the hood, which holds a transparent fuel container. Simply connect the fuel line straight to that container, and you can accurately measure fuel consumption.

On mythbusters, they used a flow gauge, like you would use for gas lines or water lines (not sure which)... it shows instant fuel consumption at a particular speed and rpm, but not average.

On the Innova, CRV, etcetera... the fuel consumption meter is an estimate based on average and instant consumption, estimated by the computer based (I think... not sure) on the injector duty cycle. There is no actual sensor in the fuel line that measures flow-rates as in Mythbusters.