I copied and pated this from a website:
How does it work?
The heart of the Gtech Pro is a precision silicon accelerometer. An accelerometer is a sensor that measures acceleration, also known as G-Force. G-Force is what's keeping you in your seat as you are reading these words and if it wasn't for the seat you would be accelerating to the ground at 1G (32 feet per second per second).
Gtech Pro measures your speed and distance traveled by integrating acceleration over time. Basically, if you know how fast you are accelerating for a certain time period you'll know how much your speed has changed after that time period. So, if you start of from zero speed then you'll know what your speed is after every time period. These time periods are very small (2.5 milliseconds) and that's how Gtech Pro maintains its accuracy.
Distance is measured in the same fashion, if you know how fast you are going for a certain time period you will know what is the distance traveled during that time period.
Gtech Pro also measures delivered Horsepower, sometimes called Rear Wheel Horsepower. This horsepower includes the loss of power through the drivetrain which is usually 10-15%. The formula for Horsepower is speed times acceleration times the weight of the vehicle.