Skip to content

Commit f59ed3b

Browse files
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]>
1 parent 3471c5b commit f59ed3b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

xml/System.Threading/Timer.xml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ Sub TimerCallback(state As Object)
607607
<Parameter Name="period" Type="System.Int64" Index="1" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1;netcore-3.1" />
608608
</Parameters>
609609
<Docs>
610-
<param name="dueTime">The amount of time to delay before the invoking the callback method specified when the <see cref="T:System.Threading.Timer" /> was constructed, in milliseconds. Specify <see cref="F:System.Threading.Timeout.Infinite" /> to prevent the timer from restarting. Specify zero (0) to restart the timer immediately.</param>
610+
<param name="dueTime">The amount of time to delay before the invoking the callback method specified when the <see cref="T:System.Threading.Timer" /> was constructed, in milliseconds. Specify <see cref="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>
611611
<param name="period">The time interval between invocations of the callback method specified when the <see cref="T:System.Threading.Timer" /> was constructed, in milliseconds. Specify <see cref="F:System.Threading.Timeout.Infinite" /> to disable periodic signaling.</param>
612612
<summary>Changes the start time and the interval between method invocations for a timer, using 64-bit signed integers to measure time intervals.</summary>
613613
<returns>
@@ -627,8 +627,11 @@ Sub TimerCallback(state As Object)
627627
]]></format>
628628
</remarks>
629629
<exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Threading.Timer" /> has already been disposed.</exception>
630-
<exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="dueTime" /> or <paramref name="period" /> parameter is less than -1.</exception>
631-
<exception cref="T:System.NotSupportedException">The <paramref name="dueTime" /> or <paramref name="period" /> parameter is greater than 4294967294.</exception>
630+
<exception cref="T:System.ArgumentOutOfRangeException"><paramref name="dueTime" /> or <paramref name="period" /> is less than -1.
631+
632+
-or-
633+
634+
<paramref name="dueTime" /> or <paramref name="period" /> is greater than 4294967294.</exception>
632635
<related type="Article" href="~/docs/standard/threading/timers.md">Timers</related>
633636
</Docs>
634637
</Member>

0 commit comments

Comments
 (0)