public void GetUtcNowAccuracyIsMilliseconds()
        {
            SystemClockMillisecondsAccuracy.GetUtcNow();

            var nowActual   = SystemClockMillisecondsAccuracy.GetUtcNow();
            var nowExpected = DateTimeOffset.UtcNow;

            var diff = nowExpected - nowActual;
            var ms   = Math.Abs(diff.TotalMilliseconds);

            Assert.True(ms < 1.0);
        }
        public void GetUtcNowHasNonZeroMilliseconds()
        {
            var sw = Stopwatch.StartNew();

            var startTime = SystemClockMillisecondsAccuracy.GetUtcNow();

            SpinWait.SpinUntil(() => sw.ElapsedMilliseconds > 1, 2);

            var endTime = SystemClockMillisecondsAccuracy.GetUtcNow();

            Assert.True(sw.ElapsedMilliseconds > 0);

            var duration = endTime - startTime;

            Assert.NotEqual(0.0, duration.TotalMilliseconds);
        }