C# Класс GSF.Threading.SharedTimer

Represents a timer class that will group registered timer event callbacks that operate on the same interval in order to optimize thread pool queuing.

Externally the SharedTimer operations similar to the System.Timers.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.

Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Close ( ) : void

Stops the timer.

Dispose ( ) : void

Stops the timer and prevents reuse of the class.

Start ( ) : void

Starts raising the Elapsed event by setting Enabled to true.

Stop ( ) : void

Stops raising the Elapsed event by setting Enabled to false.

Приватные методы

Метод Описание
SharedTimer ( SharedTimerScheduler scheduler, int interval = 100 ) : System
TimerCallback ( System.DateTime state ) : void

Callback from SharedTimerScheduler.

Описание методов

Close() публичный Метод

Stops the timer.
public Close ( ) : void
Результат void

Dispose() публичный Метод

Stops the timer and prevents reuse of the class.
public Dispose ( ) : void
Результат void

Start() публичный Метод

Starts raising the Elapsed event by setting Enabled to true.
public Start ( ) : void
Результат void

Stop() публичный Метод

Stops raising the Elapsed event by setting Enabled to false.
public Stop ( ) : void
Результат void