System.Timers Namespace (original) (raw)

Skip to main contentSkip to in-page navigation

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

System.Timers Namespace

Provides the Timer component, which allows you to raise an event on a specified interval.

Classes

ElapsedEventArgs Provides data for the Elapsed event.
Timer Generates an event after a set interval, with an option to generate recurring events.
TimersDescriptionAttribute Sets the description that visual designers can display when referencing an event, extender, or property.

Delegates

Remarks

The Timer component is a server-based timer, which allows you to specify a recurring interval at which the Elapsed event is raised in your application. You can then handle this event to provide regular processing. For example, suppose you have a critical server that must be kept running 24 hours a day, 7 days a week. You could create a service that uses a Timer to periodically check the server and ensure that the system is up and running. If the system is not responding, the service could attempt to restart the server or notify an administrator.

The server-based Timer is designed for use with worker threads in a multithreaded environment. Server timers can move among threads to handle the raised Elapsed event, resulting in more accuracy than Windows timers in raising the event on time.

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.

Additional resources

In this article