Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Timer.Change Method (Int64, Int64)

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)

public:
bool Change (
	long long dueTime, 
	long long period
)
public boolean Change (
	long dueTime, 
	long period
)
public function Change (
	dueTime : long, 
	period : long
) : boolean
Not applicable.

Parameters

dueTime

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

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

true if the current instance has not been disposed; otherwise, false.
Exception typeCondition

ObjectDisposedException

The Timer has already been disposed.

ArgumentOutOfRangeException

The dueTime or period parameter is less than -1.

NotSupportedException

The dueTime or period parameter is greater than 4294967294.

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.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0

XNA Framework

Supported in: 1.0

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.