// Using HttpRequest.js - for creating XmlHttpRequest function TestConnectionSpeed(garbageFile) { if (garbageFile != "") { var date = new Date(); var startTime = date.getTime(); Http.get({ url: garbageFile, callback: ConnectionSpeedCallback, cache: Http.Cache.GetNoCache }, [startTime]); } } function CalculateThroughput(startTime) { var dataSize = 204800; // in Bytes date = new Date(); var endTime = date.getTime(); var kBits = 0; var throughput = 0; var diffTimeMilliseconds = endTime - startTime; var diffTimeSeconds = diffTimeMilliseconds / 1000; var bits = (dataSize * 8); // convert Bytes to bits, kBits = bits / 1024; // convert bits to kbits throughput = kBits / (diffTimeSeconds); throughput = throughput * .93; // account for IP packet header overhead - averages about 7% throughput = Math.round(throughput * 100) / 100; // round to the hundreth place return throughput; } function DetermineConnectionType(throughput) { var temp = ""; if (throughput > 0 && throughput <= 56) { // Dialup temp = 'Dialup'; } else if (throughput > 56 && throughput <= 184) { // DSL temp = 'DSL'; } else if (throughput > 184) { // Cable or LAN/T1 temp = 'Cable or LAN/T1'; } else { // Could not determine temp = 'Undetermined'; } return temp; }