Its not as hard as it sounds anyone can do this by throwing some javascript. Most of the speed test sites that are available, downloads a predefined file (a jpg or something with known size) and then uses javascript to find the time elapsed and then calculate