示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ClockTimer"/> class.
        /// </summary>
        public ClockTimer()
        {
            var timer = CurrentProvider.Create();

            this.stopwatch          = timer.stopwatch;
            this.stopwatchInterface = timer.stopwatchInterface;
        }
示例#2
0
 /// <summary>
 /// Pins the implementation of the timer returned to use for all callers until the disposable is disposed.
 /// </summary>
 /// <param name="timer">The date and time to the clock.</param>
 /// <returns>The disposer that manages the lifetime of the scoped pinned value.</returns>
 public static IDisposable Pin(IPinnedClockTimer timer)
 {
     return(Pin(new PinnedClockTimerProvider(timer)));
 }
示例#3
0
 internal ClockTimer(IPinnedClockTimer stopwatch)
 {
     this.stopwatch          = null;
     this.stopwatchInterface = stopwatch;
 }
示例#4
0
 internal ClockTimer(Stopwatch stopwatch)
 {
     this.stopwatch          = stopwatch;
     this.stopwatchInterface = null;
 }