public void ReportProgress(TimeInterval progress) { if (progress.Ticks == 0) { return; } lock (innerLock) { // reportedTimeResiduum represents time that // has been reported, but not yet used; // we cannot report it again if (reportedTimeResiduum >= progress) { reportedTimeResiduum -= progress; return; } if (reportedTimeResiduum != TimeInterval.Empty) { progress -= reportedTimeResiduum; reportedTimeResiduum = TimeInterval.Empty; } this.Trace($"Reporting progress: {progress}"); TotalElapsedTime += progress; reportedSoFar += progress; TimeSource.ReportTimeProgress(); } }
public void ReportProgress(TimeInterval progress) { if (progress.Ticks == 0) { return; } lock (innerLock) { this.Trace($"Reporting progress: {progress}"); TotalElapsedTime += progress; reportedSoFar += progress; TimeSource.ReportTimeProgress(this, progress); } }