public void Stop() { IsRunning = false; MyStopWatch.Stop(); EndTime = DateTime.Now; var ctx = new TimeTrackerEntities(); DJobTiming timing = ctx.DJobTimings.FirstOrDefault(x => x.JobTimingId == JobTimingId); timing.EndTime = EndTime; timing.IsRunning = false; ctx.SaveChanges(); }
public async void CheckUrl(string url) { ProccessIsDone = false; MyStopWatch.Restart(); WebRequest webRequest = WebRequest.Create(url); WebResponse response = await webRequest.GetResponseAsync(); using (StreamReader reader = new StreamReader(response.GetResponseStream())) { string numberOfCharacters = await reader.ReadToEndAsync(); UrlSize = $"The Size Of Your Site Is: {numberOfCharacters.Length.ToString()} Bytes."; } ProccessIsDone = true; MyStopWatch.Stop(); }
public void End() { cumulative.Stop(); }