public void ScanSite(string url, string postData) { request = CreateRequest(url); state = new RequestState(request); MethodPost(url, postData); }
public void ScanSiteStopWatch(string url, string postData) { request = WebRequest.Create(url); stopWatch = new Stopwatch(); stopWatch.Start(); state = new RequestState(request); if(postData == null) { MethodGet(); } else { MethodPost(url, postData); } stopWatch.Stop(); long elapseTime = stopWatch.ElapsedMilliseconds; // ReSharper disable LocalizableElement Console.WriteLine("----------------------- ELAPSED TIME BETWEEN CALLS ---------------------\n{0}: {1} {2} ms on threadId " + Thread.CurrentThread.ManagedThreadId + "\n------------------------------------------------------------------------", "Get Execution on url ", url, elapseTime.ToString()); // ReSharper restore LocalizableElement stopWatch.Reset(); }