Provides a repeating timer with associated tick event.

Namespace: ASCOM.Utilities
Assembly: ASCOM.Utilities (in ASCOM.Utilities.dll) Version: 6.0.0.0 (6.1.1.2619)

Syntax

C#
[ObsoleteAttribute("Please replace it with Systems.Timers.Timer, which is reliable in all console and non-windowed applications.", 
	false)]
public class Timer : ITimer, IDisposable
Visual Basic
<ObsoleteAttribute("Please replace it with Systems.Timers.Timer, which is reliable in all console and non-windowed applications.",  _
	False)> _
Public Class Timer _
	Implements ITimer, IDisposable
Visual C++
[ObsoleteAttribute(L"Please replace it with Systems.Timers.Timer, which is reliable in all console and non-windowed applications.", 
	false)]
public ref class Timer : ITimer, 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.

Inheritance Hierarchy

System..::..Object
  ASCOM.Utilities..::..Timer

See Also