/// <summary> /// Write and display a report of the timing /// results in a text file. /// </summary> public void Report(string description) { TimeRegistry.WriteResults(description, _duration); }
/// <summary> /// Automatic disposal when the the using statement /// block finishes: the timer is stopped and the /// time is registered. /// </summary> void IDisposable.Dispose() { _timer.Stop(); _duration = _timer.Elapsed.TotalSeconds; TimeRegistry.AddTime(_key, _duration); }