Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
using System;
using System.Diagnostics;
using System.Net;
namespace ConsoleApplication1 {
internal class Program {
private const int COUNT = 20;
private static void Main() {
var urls = new[] {
"http://sstatic.net/js/full.js",
"http://sstatic.stackexchange.netdna-cdn.com/js/full.js",
"http://d1d5ue6vu5b30i.cloudfront.net/js/full.js",
"http://wac.43df.edgecastcdn.net/8043DF/sstatic/js/full.js"
};
foreach (var url in urls) {
MeasureUrl(url);
}
Console.ReadLine();
}
private static void MeasureUrl(string url) {
var client = new WebClient();
var sw = Stopwatch.StartNew();
var rand = new Random();
for (var i = 0; i < COUNT; ++i) {
client.DownloadData(string.Format("{0}?rand={1}", url, rand.Next()));
}
sw.Stop();
Console.WriteLine("URL {0} took {1} ms", url, (sw.ElapsedMilliseconds/COUNT));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.