-4
2
From the wikipedia:
Net neutrality is the principle that Internet service providers and governments regulating the Internet should treat all data on the Internet the same, not discriminating or charging differentially by user, content, website, platform, application, type of attached equipment, or mode of communication.
Your task is to find if your internet connection is being throttled by your ISP or if the net is neutral.
What you actually have to do
Your program or function will be run twice. It needs to have some form of memory or storage between its two calls, like writing to a file, a static
var in C++, setting a property on a function in JS, or just a global variable.
The first time it is run, it must connect to google.com (a fairly popular site), and a different website with an Alexa rank of greater than 1 million, like unlicense.org.
It must record the time it took google.com to respond*, and the time it took the other website to respond*.
The second time it is run, it must do the above, and print a truthy value if these are both true:
- The response time between google.com the first and second time varied by less than 5%. (Google paid ISP to not throttle)
- The response time between the other site the first and second time increased by more than 50%. (Other site didn't)
Shortest code wins!
* The time it to get the response body, headers, or just connect with the server. You choose.
2Is there any method you could recommend of finding such a site with an Alexa ranking greater than 1 million? – notjagan – 2017-07-16T22:47:04.867
@notjagan done. – programmer5000 – 2017-07-16T23:04:00.287
Why the downvotes? – programmer5000 – 2017-07-16T23:04:59.287
To clarify, you mean a site with a larger rank and thus lower traffic, right? I at first thought you meant a high rank. – Rɪᴋᴇʀ – 2017-07-16T23:11:18.463
Also, theoretically, wouldn't it be a much longer time based on the location of the site's servers? – Rɪᴋᴇʀ – 2017-07-16T23:11:44.823
@Riker Yep. Latency and ping would do a good lot, but unlicense is run by github, so servers for both sites should be pretty well distributed. – Zizouz212 – 2017-07-16T23:13:51.923
1Also, the time to get the full response body is pointless. It will take much longer to download larger bodies than others. Google is likely a much smaller body than unlicense. You should be measuring the time between when the request is submitted, and the first headers are received. – Zizouz212 – 2017-07-16T23:15:25.430
I think having to run it twice is a bad idea. One run please? – Christopher – 2017-07-17T00:55:42.977
@Zizouz212 fixed. – programmer5000 – 2017-07-17T15:48:28.627