mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-15 04:35:00 +00:00
fix: The SafeTimer constructor that executes the callback immediately now works as expected
This commit is contained in:
committed by
Chris Cameron
parent
c1b9426e32
commit
d090ab0085
@@ -36,7 +36,7 @@ namespace ICD.Common.Utils.Timers
|
||||
/// <param name="callback"></param>
|
||||
/// <param name="repeatPeriod"></param>
|
||||
public SafeTimer(Action callback, long repeatPeriod)
|
||||
: this(callback, -1, repeatPeriod)
|
||||
: this(callback, 0, repeatPeriod)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ namespace ICD.Common.Utils.Timers
|
||||
if (repeatPeriod < 0 && repeatPeriod != Timeout.Infinite)
|
||||
throw new ArgumentOutOfRangeException("repeatPeriod", "Repeat period must be greater than or equal to 0ms");
|
||||
|
||||
if (dueTime >= int.MaxValue)
|
||||
if (repeatPeriod >= int.MaxValue)
|
||||
throw new ArgumentOutOfRangeException("repeatPeriod", string.Format("Repeat period must be less than {0:n0}ms", int.MaxValue));
|
||||
|
||||
#if SIMPLSHARP
|
||||
|
||||
Reference in New Issue
Block a user