Permalink
Browse files

finally happy with the precision this will offer, and it is much more…

… straight forward than the previous generation
  • Loading branch information...
1 parent c6218d0 commit 3733d29bbba8335796e7d087118e35be4a8a2f0c @nberardi nberardi committed Sep 21, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/System/DateTimePrecise.cs
@@ -56,7 +56,9 @@ public DateTimeOffset GetUtcNow()
if (elapsedSeconds > _syncSeconds) {
Syncronize();
- return _baseTime;
+
+ // account for any time that has passed since the stopwatch was syncronized
+ elapsedSeconds = _stopwatch.ElapsedTicks / (double)Stopwatch.Frequency;
}
var elapsedTicks = Convert.ToInt64(elapsedSeconds * TicksInOneSecond);

0 comments on commit 3733d29

Please sign in to comment.