I have to make alikation which is to measure the response time of site. Application can not be blocked during the response / request process?
Help please!

1) Get the site URI
2) Start a Stopwatch
3) Get site using HttpRequest
4) Stop Stopwatch
5) Profit!

Make an application that measures the response time of a site. Application can not be blocked during the response / request process.

The application should have a textbox control to enter an address. Label, to display the speed of response and two buttons, start and stop. If the start button is pressed, the button does not stop must be enabled

and i have code for Measure speed:

public void res()
        {
            System.Diagnostics.Stopwatch t = new System.Diagnostics.Stopwatch();
            t.Start();
            System.Net.HttpWebRequest req = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(textBox1.Text);
            System.Net.HttpWebResponse res = (System.Net.HttpWebResponse)req.GetResponse();
            t.Stop();
            res.Close();
            label1.Text=t.Elapsed.ToString();

        }

this look

Looks like it's working

No that is only example of how work should be. :(

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.