Maybe you need the GTmetrix service. It is excellent and free. You cannot program it yourself, but it will automatically track your sites, and thatโs really all you need.
Actual download speeds are insidious and unreliable. They greatly depend on your choice of browser, network activity, geographic location, local memory usage, etc. You should not use download speeds for optimization. Optimize for YSlow and Page Speed โโonly.
source share