Change Method (Int64, Int64)
Collapse the table of content
Expand the table of content

Timer.Change Method (Int64, Int64)

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Changes the start time and the interval between method invocations for a timer, using 64-bit signed integers to measure time intervals.

Namespace:  System.Threading
Assembly:  mscorlib (in mscorlib.dll)

'Declaration
Public Function Change ( _
	dueTime As Long, _
	period As Long _
) As Boolean

Parameters

dueTime
Type: System.Int64
The amount of time to delay before the invoking the callback method that was specified when the Timer was constructed, in milliseconds. Specify Timeout.Infinite to prevent the timer from restarting. Specify 0 (zero) to restart the timer immediately.
period
Type: System.Int64
The time interval between invocations of the callback method that was specified when the Timer was constructed, in milliseconds. Specify Timeout.Infinite to disable periodic signaling.

Return Value

Type: System.Boolean
true if the timer was successfully updated; otherwise, false.

ExceptionCondition
ObjectDisposedException

The Timer has already been disposed.

ArgumentOutOfRangeException

The dueTime or period parameter is negative and is not equal to Timeout.Infinite.

-or-

The dueTime or period parameter is greater than 4294967294 (UInt32.MaxValue - 1).

The callback method is invoked once after dueTime elapses, and thereafter each time the time interval specified by period elapses.

If dueTime is 0 (zero), the callback method is invoked immediately. If dueTime is Timeout.Infinite, the callback method is never invoked; the timer is disabled but can be re-enabled by calling Change and specifying a positive value for dueTime.

If period is 0 (zero) or Timeout.Infinite, and dueTime is not Timeout.Infinite, the callback method is invoked once; the periodic behavior of the timer is disabled but can be re-enabled by calling Change and specifying a positive value for period.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft