Table of Contents

Class SimpleResettableTimer

Namespace
Ecng.Common
Assembly
Ecng.Common.dll

Represents a simple timer that can be reset. When the timer period elapses without a reset, the Elapsed event is invoked.

public class SimpleResettableTimer : IDisposable
Inheritance
SimpleResettableTimer
Implements
Inherited Members
Extension Methods

Constructors

SimpleResettableTimer(TimeSpan)

Represents a simple timer that can be reset. When the timer period elapses without a reset, the Elapsed event is invoked.

public SimpleResettableTimer(TimeSpan period)

Parameters

period TimeSpan

Methods

Dispose()

Disposes the timer and stops any further executions.

public void Dispose()

Flush()

Forces the timer to immediately run its elapsed logic if it is running, effectively flushing the timer cycle.

public void Flush()

Reset()

Resets the timer. If the timer is not already running, it starts the timer with the specified period. If it is running, it marks that the timer should restart the count.

public void Reset()

Events

Elapsed

Occurs when the timer elapses without being reset.

public event Action Elapsed

Event Type

Action