public static Timer operator -(Timer t1, Timer t2) { AssertAssistant.Assert(t1 != null); AssertAssistant.Assert(t2 != null); AssertAssistant.Assert(t1.state == TimerState.TS_STOPPED); AssertAssistant.Assert(t2.state == TimerState.TS_STOPPED); return(new Timer(t1.clockTicks - t2.clockTicks)); }
public double ClockTicks() { AssertAssistant.Assert(state == TimerState.TS_STOPPED); return(clockTicks); }
public void Stop() { AssertAssistant.Assert(state == TimerState.TS_STARTED); clockTicks += DateTime.Now.Ticks - start; state = TimerState.TS_STOPPED; }
public void Start() { AssertAssistant.Assert(state == TimerState.TS_STOPPED); state = TimerState.TS_STARTED; start = DateTime.Now.Ticks; }