/// <summary> /// Initializes a new instance of the <see cref="TimeOuts" /> class. /// </summary> /// <param name="period">The period.</param> /// <param name="dueTime">The due time.</param> /// <param name="minimumGap">The minimum gap.</param> /// <param name="timeStamp">The time stamp.</param> /// <param name="dueTimeStamp">The due time stamp.</param> public TimeOuts( Duration period, Duration dueTime, Duration minimumGap, long timeStamp, long? dueTimeStamp = null) { TimeStamp = timeStamp; DueTimeMs = dueTime < Duration.Zero ? -1 : (int)dueTime.TotalMilliseconds(); MinimumGapMs = minimumGap < Duration.Zero ? -1 : (int)minimumGap.TotalMilliseconds(); PeriodMs = period < Duration.Zero ? -1 : (period < MinimumPeriod ? MinimumPeriodMs : (int)period.TotalMilliseconds()); DueTimeStamp = dueTime < Duration.Zero ? long.MaxValue : (dueTimeStamp ?? TimeStamp + (DueTimeMs * NodaConstants.TicksPerMillisecond)); }
/// <summary> /// Initializes a new instance of the <see cref="BufferedAction" /> class. /// </summary> /// <param name="action">The action.</param> /// <param name="duration">The duration is the amount of time the result of a successful execution is held, after the point a successful request was made.</param> /// <exception cref="ArgumentNullException"><paramref name="action"/> is <see langword="null" />.</exception> /// <exception cref="ArgumentOutOfRangeException"><paramref name="duration"/> is less than or equal to zero.</exception> public BufferedAction( [NotNull] Action<object[][]> action, Duration duration) : this(action, (long)duration.TotalMilliseconds()) { }