Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/Build/BackEnd/Components/Scheduler/ScheduleTimeRecord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,22 @@ public ScheduleTimeRecord()

/// <summary>
/// Retrieve the accumulated time.
/// If the timer is still running, returns the accumulated time so far
/// (elapsed time since the timer started plus any previously accumulated time)
/// instead of throwing. This prevents a crash in diagnostic summary logging
/// from killing the BuildManager work queue and hanging VS indefinitely.
/// See: https://github.com/dotnet/msbuild/issues/XXXXX
Comment thread
YuliiaKovalova marked this conversation as resolved.
Outdated
/// </summary>
public TimeSpan AccumulatedTime
{
get
{
ErrorUtilities.VerifyThrow(_startTimeForCurrentState == DateTime.MinValue, "Can't get the accumulated time while the timer is still running.");
if (_startTimeForCurrentState != DateTime.MinValue)
{
// Timer is still running — return best-effort elapsed time.
return _accumulatedTime + (DateTime.UtcNow - _startTimeForCurrentState);
}
Comment thread
YuliiaKovalova marked this conversation as resolved.

return _accumulatedTime;
}
}
Expand Down
Loading