var start = (new Date()).getTime();
var THRESHOLD = 2400; // a number we will calculate below

function speedTest() {
    var duration = (new Date()).getTime() - start;
    if (duration > THRESHOLD) {
       alert("Your internet connection appears to be quite slow. It may take a second until the movie will start after clicking.");
    }
    return;
}
