Skip to content

v1.0.0-rc.2

Pre-release
Pre-release
Compare
Choose a tag to compare
@egil egil released this 25 Sep 14:11
· 9 commits to main since this release
  • Added ActiveTimers property to ManualTimeProvider. The property will display the number of currently active timers that have a callback scheduled to be called in the future.

  • Allow ManualTimeProvider.Start to be set using property initializers.

  • Made the timer type created by ManualTimeProvider, the ManualTimer type, public, and introduced a protected method CreateManualTimer on ManualTimeProvider. This enables advanced scenarios where a custom ManualTimer is needed.

    A custom implementation of ManualTimer can override the Change method and add custom behavior to it.

    Overriding CreateManualTimer makes it possible to intercept a TimerCallback and perform actions before and after the timer callback has been invoked.

  • Replace the AutoAdvanceAmount property with the AutoAdvanceBehavior property on ManualTimeProvider, and introduce the AutoAdvanceBehavior type. To automatically advance the time when GetUtcNow() or GetLocalNow() is called, set AutoAdvanceBehavior.UtcNowAdvanceAmount to a TimeSpan larger than zero.

  • Enable auto advance feature for GetTimestamp() and GetElapsedTime(long). To automatically advance the time when GetTimestamp() or GetElapsedTime(long) is called, set AutoAdvanceBehavior.TimestampAdvanceAmount to a TimeSpan larger than zero.

  • ManualTimer now exposes its current configuration. DueTime, Period, IsActive, CallbackTime, and CallbackInvokeCount are now publicly visible.

  • Enable auto-advance feature for timers. This enables automatically calling timers callback a specified number of times, by setting the AutoAdvanceBehavior.TimerAutoTriggerCount property to a number larger than zero.

Full Changelog: v1.0.0-rc.1...v1.0.0-rc.2