[ObsoleteAttribute("Please replace it with Systems.Timers.Timer, which is reliable in all console and non-windowed applications.",
false)]
public class Timer : IDisposable<ObsoleteAttribute("Please replace it with Systems.Timers.Timer, which is reliable in all console and non-windowed applications.",
false)>
Public Class Timer
Implements IDisposable[ObsoleteAttribute(L"Please replace it with Systems.Timers.Timer, which is reliable in all console and non-windowed applications.",
false)]
public ref class Timer : IDisposableThe 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.
| Timer | Create a new timer component |
| Enabled | Enable the timer tick events |
| Interval | The interval between Tick events when the timer is Enabled in milliseconds, (default = 1000) |
| Dispose | Disposes of resources used by the profile object |
| Tick | Fired once per Interval when timer is Enabled. |