Click or drag to resize
Timer Class

Note: This API is now obsolete.

Provides a repeating timer with associated tick event.
Inheritance Hierarchy
SystemObject
  ASCOM.UtilitiesTimer

Namespace: ASCOM.Utilities
Assembly: ASCOM.Utilities (in ASCOM.Utilities.dll) Version: 6.0.0.0 (6.3.0.2839)
Syntax
[ObsoleteAttribute("Please replace it with Systems.Timers.Timer, which is reliable in all console and non-windowed applications.", 
	false)]
public class Timer : IDisposable

The Timer type exposes the following members.

Constructors
  NameDescription
Public methodTimer
Create a new timer component
Top
Properties
  NameDescription
Public propertyEnabled
Enable the timer tick events
Public propertyInterval
The interval between Tick events when the timer is Enabled in milliseconds, (default = 1000)
Top
Methods
  NameDescription
Public methodDispose
Disposes of resources used by the profile object
Top
Events
  NameDescription
Public eventTick
Fired once per Interval when timer is Enabled.
Top
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.

See Also