You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation is wrong for Timer.Change method (#3762)
* The documentation is wrong for Timer.Change method
The documentation for the following overload of Timer.Change is incorrect:
public bool Change (long dueTime, long period);
If you use a value for the dueTime parameter that is greater than 4294967294, the method throws an ArgumentOutOfRangeException, not a NotSupportedException as the documentation claims. I'm not sure which exception is thrown if the period parameter is greater than 4294967294. I didn't test that. You might want to check and verify. You should make it clear in the parameter description that values over 4294967294 are not valid. We ran into this problem and it took a little while to debug because the documentation was not clear and plain wrong. Thank you!
* Update xml/System.Threading/Timer.xml
Co-Authored-By: Maira Wenzel <[email protected]>
* Update xml/System.Threading/Timer.xml
Co-Authored-By: Maira Wenzel <[email protected]>
Co-authored-by: Maira Wenzel <[email protected]>
<paramname="dueTime">The amount of time to delay before the invoking the callback method specified when the <seecref="T:System.Threading.Timer" /> was constructed, in milliseconds. Specify <seecref="F:System.Threading.Timeout.Infinite" /> to prevent the timer from restarting. Specify zero (0) to restart the timer immediately.</param>
610
+
<paramname="dueTime">The amount of time to delay before the invoking the callback method specified when the <seecref="T:System.Threading.Timer" /> was constructed, in milliseconds. Specify <seecref="F:System.Threading.Timeout.Infinite" /> to prevent the timer from restarting. Specify zero (0) to restart the timer immediately. This value must be less than or equal to 4294967294.</param>
611
611
<paramname="period">The time interval between invocations of the callback method specified when the <seecref="T:System.Threading.Timer" /> was constructed, in milliseconds. Specify <seecref="F:System.Threading.Timeout.Infinite" /> to disable periodic signaling.</param>
612
612
<summary>Changes the start time and the interval between method invocations for a timer, using 64-bit signed integers to measure time intervals.</summary>
613
613
<returns>
@@ -627,8 +627,11 @@ Sub TimerCallback(state As Object)
627
627
]]></format>
628
628
</remarks>
629
629
<exceptioncref="T:System.ObjectDisposedException">The <seecref="T:System.Threading.Timer" /> has already been disposed.</exception>
630
-
<exceptioncref="T:System.ArgumentOutOfRangeException">The <paramrefname="dueTime" /> or <paramrefname="period" /> parameter is less than -1.</exception>
631
-
<exceptioncref="T:System.NotSupportedException">The <paramrefname="dueTime" /> or <paramrefname="period" /> parameter is greater than 4294967294.</exception>
630
+
<exceptioncref="T:System.ArgumentOutOfRangeException"><paramrefname="dueTime" /> or <paramrefname="period" /> is less than -1.
631
+
632
+
-or-
633
+
634
+
<paramrefname="dueTime" /> or <paramrefname="period" /> is greater than 4294967294.</exception>
0 commit comments