Timer Constructor (Double)
.NET Framework (current version)
Initializes a new instance of the Timer class, and sets the Interval property to the specified number of milliseconds.
Assembly: System (in System.dll)
Parameters
- interval
-
Type:
System::Double
The time, in milliseconds, between events. The value must be greater than zero and less than or equal to Int32::MaxValue.
| Exception | Condition |
|---|---|
| ArgumentException | The value of the interval parameter is less than or equal to zero, or greater than Int32::MaxValue. |
This constructor sets the Interval property of the new timer instance, but does not enable the timer.
The following example instantiates a Timer object that fires its Timer::Elapsed event every two seconds (2000 milliseconds), sets up an event handler for the event, and starts the timer. The event handler displays the value of the ElapsedEventArgs::SignalTime property each time it is raised.
.NET Framework
Available since 1.1
Available since 1.1
Show: