/// <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; }
/// <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))); }
internal ClockTimer(IPinnedClockTimer stopwatch) { this.stopwatch = null; this.stopwatchInterface = stopwatch; }
internal ClockTimer(Stopwatch stopwatch) { this.stopwatch = stopwatch; this.stopwatchInterface = null; }