Permalink
Browse files

added in a line of code to make sure elapsed isn't negative thanks to @…

…adamralph for reminding me of this bug in Stopwatch
  • Loading branch information...
1 parent da680fb commit e146ad6440d0b8ccbf27807dc4dce33722047b5c @nberardi nberardi committed Sep 21, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/System/DateTimePrecise.cs
@@ -62,6 +62,9 @@ public DateTimeOffset GetUtcNow()
elapsed = _stopwatch.Elapsed;
}
+ if (elapsed < TimeSpan.Zero)
+ elapsed = TimeSpan.Zero;
+
return _baseTime + elapsed;
}
}

0 comments on commit e146ad6

Please sign in to comment.