Shared
|
public sealed class SharedTimer : IDisposable
The SharedTimer type exposes the following members.
Name | Description | |
---|---|---|
AutoReset | Gets or sets flag that indicates whether the SharedTimer should raise the Elapsed event only once false or repeatedly true. | |
Enabled | Gets or sets flag that indicates whether the SharedTimer should raise the Elapsed event. | |
Interval | Gets or sets the interval at which to raise the Elapsed event. |
Name | Description | |
---|---|---|
Close | Stops the timer. | |
Dispose | Stops the timer and prevents reuse of the class. | |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) | |
GetHashCode | Serves as the default hash function. (Inherited from Object) | |
GetType | Gets the Type of the current instance. (Inherited from Object) | |
Start | Starts raising the Elapsed event by setting Enabled to true. | |
Stop | Stops raising the Elapsed event by setting Enabled to false. | |
ToString | Returns a string that represents the current object. (Inherited from Object) |
Name | Description | |
---|---|---|
Elapsed | Occurs when the timer interval elapses. | |
UnhandledExceptions | Occurs when Elapsed event throws an exception. |
Name | Description | |
---|---|---|
GetEnumValueOrDefault |
Gets the enumeration constant for value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions) | |
GetEnumValueOrDefaultT |
Gets the enumeration constant for this value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions) |
Externally the SharedTimer operations similar to the Timer. Internally the timer pools callbacks with the same Interval into a single timer where each callback is executed on the same thread, per instance of the SharedTimerScheduler.
Any long running callbacks that have a risk of long delays should not use SharedTimer as this will effect the reliability of all of the other SharedTimer instances for a given SharedTimerScheduler.