title: How to check response time of a website with javascript?
body: <p>I check response time of a website in c# with httpwebrequest and measure the time with stopwatch. How to do a webrequest and a good way as stopwatch to check the time with javascript?</p>
  
  <p>Here is my c# sample.</p>
  
  <pre><code> Uri URL = new Uri("http://www.example.com");                    
   HttpWebRequest request = (HttpWebRequest)WebRequest.Create(URL);
   request.Timeout = 10000;
   Stopwatch stopWatch = new Stopwatch();
   stopWatch.Start();
   HttpWebResponse response = (HttpWebResponse)request.GetResponse();
   response.Close();
   stopWatch.Stop();
   int ms = stopWatch.Elapsed.Milliseconds;
  </code></pre>