public void Stop() { switch (state) { case State.Running: { state = State.Stopped; stopWatch.Stop(); totalElapsed += stopWatch.Elapsed; stopWatch.Reset(); } break; case State.Stopped: { } break; default: { Contract.Assert(false); break; } } }
public bool TryInferConditions(ProofObligation obl, ICodeFixesManager codefixesManager, out InferredConditions preConditions) { var watch = new CustomStopwatch(); watch.Start(); var result = inner.TryInferConditions(obl, codefixesManager, out preConditions); watch.Stop(); inferenceTime += watch.Elapsed; if (preConditions == null) { return(false); } if (result) { inferred += preConditions.Count(); } return(result); }