Timer Constructor

Initializes a new instance of the Timer class, and sets all the properties to their initial values.

Namespace:  System.Timers
Assembly:  System (in System.dll)

new : unit -> Timer

The following table shows initial property values for an instance of Timer.

Property

Initial value

AutoReset

true

Enabled

false

Interval

100 milliseconds

SynchronizingObject

A null reference (Nothing in Visual Basic).

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.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft