Timer Class

Note: This API is now obsolete.
Provides a repeating timer with associated tick event.

Definition

Namespace: ASCOM.Utilities
Assembly: ASCOM.Utilities (in ASCOM.Utilities.dll) Version: 7.1.3+4851.c5da65c2b
C#
[ObsoleteAttribute("Please replace it with Systems.Timers.Timer, which is reliable in all console and non-windowed applications.", 
	false)]
public class Timer : IDisposable
Inheritance
Object    Timer
Implements
IDisposable

Remarks

The interval resolution is about 20ms.If you need beter than this, you could use the WaitForMilliseconds method to create your own solution.

You can create multiple instances of this object. When enabled, the Timer delivers Tick events periodically (determined by setting the Interval property).

This component is now considered obsolete for use in .NET clients and drivers. It is reliable under almost all circumstances but there are some environments, noteably console and some scripted applications, where it fails to fire. The Platform 6 component improves performance over the Platform 5 component in this respect and can be further tuned for particular applications by placing an entry in the ForceSystemTimer Profile key.

For .NET applications, use of System.Timers.Timer is recommended but atention must be paid to getting threading correct when using this control. The Windows.Forms.Timer control is not an improvement over the ASCOM timer which is based upon it.

Developers using non .NET languages are advised to use timers provided as part of their development environment, only falling back to the ASCOM Timer if no viable alternative can be found.

Constructors

Timer Create a new timer component

Properties

Enabled Enable the timer tick events
Interval The interval between Tick events when the timer is Enabled in milliseconds, (default = 1000)

Methods

Dispose Disposes of resources used by the profile object

Events

Tick Fired once per Interval when timer is Enabled.

See Also