Export (0) Print
Expand All

Timer.Change Method (UInt32, UInt32)

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

This API is not CLS-compliant. 

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

[CLSCompliantAttribute(false)]
public bool Change(
	uint dueTime,
	uint period
)

Parameters

dueTime
Type: System.UInt32

The amount of time to delay before the invoking the callback method specified when the Timer was constructed, in milliseconds. Specify Timeout.Infinite to prevent the timer from restarting. Specify zero (0) to restart the timer immediately.

period
Type: System.UInt32

The time interval between invocations of the callback method 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.

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

If dueTime is zero (0), the callback method is invoked immediately. If dueTime is 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 zero (0) or Infinite, and dueTime is not 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.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone 8, Silverlight 8.1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft