Timer Class |
Note: This API is now obsolete.
Namespace: ASCOM.Utilities
The Timer type exposes the following members.
Name | Description | |
---|---|---|
![]() | Enabled |
Enable the timer tick events
|
![]() | Interval |
The interval between Tick events when the timer is Enabled in milliseconds, (default = 1000)
|
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.