I beleive it measures the duration of the fuel injectors, and the odometer. Since gasolene is noncompressable, it should be fairly accurate until you are running on fumes.
That is how the Sangauge works too. For my first tank the computer calculated a little better mpg than my pencil did.