Dobb's Journal Digital Edition will be sent to applicants who qualify.
A complimentary one-year digital subscription to Dr. We introduce you to Apple's new Swift programming language, discuss the perils of being the third-most-popular mobile platform, revisit SQLite on Android , and much more!
To ensure the integrity of the test, you can run the code with Chrome dev tool throttling enabled and then see if the result matches the limitation.The image trick is cool but in my tests it was loading before some ajax calls I wanted to be complete. The worker will look like: /** * This function performs a synchronous request * and returns an object contain informations about the download * time and size */ function measure(filename) /** * Requires that we pass a base url to the worker * The worker will measure the download time needed to get * a ~0KB and a 100KB.* It will return a string that serializes this informations as * pipe separated values */ onmessage = function(e) ; I needed something similar, so I wrote https://github.com/beradrian/jsbandwidth.As I outline in this other answer here on Stack Overflow, you can do this by timing the download of files of various sizes (start small, ramp up if the connection seems to allow it), ensuring through cache headers and such that the file is really being read from the remote server and not being retrieved from cache.This doesn't necessarily require that you have a server of your own (the files could be coming from S3 or similar), but you will need somewhere to get the files from in order to test connection speed.