Timer.Change Method (Int32, Int32)
Changes the start time and the interval between method invocations for a timer, using 32-bit signed integers to measure time intervals.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- dueTime
- Type: System.Int32
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.Int32
The time interval between invocations of the callback method specified when the Timer was constructed, in milliseconds. Specify Timeout.Infinite to disable periodic signaling.
| Exception | Condition |
|---|---|
| ObjectDisposedException | The Timer has already been disposed. |
| ArgumentOutOfRangeException | The dueTime or period parameter is negative and is not equal to Infinite. |
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 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC, Xbox 360, Zune
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.