Mono Class Library: System.Threading.Timer Overview | Members

System.Threading.Timer.Change Method

Changes the start time and interval between method invocations for a timer. [Edit]

public bool Change (TimeSpan dueTime, TimeSpan period)

Parameters

dueTime
A TimeSpan set to the amount of time to delay before the delegate specified at System.Threading.Timer construction time invokes its methods. Specify Timeout.Infinite milliseconds to prevent the timer from restarting. Specify zero to restart the timer immediately. [Edit]
period
A TimeSpan set to the time interval between invocations of the methods referenced by the delegate specified at System.Threading.Timer construction time. Specify Timeout.Infinite milliseconds to disable periodic signaling. [Edit]

Returns

true if the current instance has not been disposed; otherwise, false. [Edit]

Exceptions

TypeReason
ArgumentOutOfRangeExceptiondueTime or period is negative and is not equal to Timeout.Infinite . [Edit]

Remarks

The delegate specified at System.Threading.Timer construction time invokes its methods once after dueTime elapses, and then invokes its methods each time the period time interval elapses.

If dueTime, in milliseconds, is zero, the delegate specified at System.Threading.Timer construction time performs its next invocation immediately. If dueTime is Timeout.Infinite milliseconds, no method invocation occurs. The timer is disabled, but can be re-enabled by calling this method and specifying a non-negative value for dueTime .

If period is zero or Timeout.Infinite milliseconds and dueTime is not Timeout.Infinite milliseconds, the delegate specified at System.Threading.Timer construction time invokes its methods exactly once. The periodic behavior of the timer is disabled, but can be re-enabled by calling this method and specifying a positive value for period .

[Edit]

Requirements

Namespace: System.Threading
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0