Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

… straight forward than the previous generation
  • Loading branch information...
commit 3733d29bbba8335796e7d087118e35be4a8a2f0c 1 parent c6218d0
@nberardi nberardi authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/System/DateTimePrecise.cs
View
4 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);
Please sign in to comment.
Something went wrong with that request. Please try again.