public void Start() { switch (this.state) { case TimeOutChecker.State.Stopped: this.state = TimeOutChecker.State.Running; this.start = DateTime.Now; break; } }
public TimeOutChecker(int seconds, bool start = true) { this.totalElapsed = new TimeSpan(); if (start) { this.start = DateTime.Now; this.state = TimeOutChecker.State.Running; } else this.state = TimeOutChecker.State.Stopped; this.timeout = seconds; this.exception = (TimeoutExceptionFixpointComputation) null; }
public void Stop() { switch (this.state) { case TimeOutChecker.State.Running: this.state = TimeOutChecker.State.Stopped; this.totalElapsed += DateTime.Now - this.start; this.start = new DateTime(); break; } }