I'd like to have a very simple page on my server, which uses JS to measure the time it takes to load the login web page on several remote URLs/servers. These servers are located around the world, and I'd like to measure the times in order to choose the fastest one for my location (i.e. the code will run client-side of course, on the user's browser).
Example:
server1.example.com: 200 ms
server2.example.com: 400 ms
server3.example.com: 2 ms
There's a lot of software that does this general idea (from simple pinging to wget, etc.), but I'm looking for JS code that I can use in a simple page which will try these requests and display the times.
The basic way I tried until now (simple Ajax requests using jQuery) doesn't work because of CORS errors. Any ideas for the simplest solution would be awesome.