Class Timer
Defines a timer to use for performing actions on a tick.
public class Timer : ITimer, IDisposable
- Inheritance
-
Timer
- Implements
- Inherited Members
- Extension Methods
Properties
DueTime
Gets or sets the time before initiating the first Tick event.
public TimeSpan DueTime { get; set; }
Property Value
Interval
Gets or sets the interval between initiating the Tick event.
public TimeSpan Interval { get; set; }
Property Value
IsRunning
Gets a value indicating whether the timer is currently running.
public bool IsRunning { get; }
Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Dispose(bool)
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
protected virtual void Dispose(bool disposing)
Parameters
InvokeTick()
Invokes the Tick event, if attached.
protected virtual void InvokeTick()
Exceptions
Start()
Starts the timer.
public void Start()
Start(int)
Starts the timer after the given dueTime in milliseconds.
public void Start(int dueTime)
Parameters
Start(TimeSpan)
Starts the timer after the given dueTime.
public void Start(TimeSpan dueTime)
Parameters
Stop()
Stops the timer.
public void Stop()
Events
Tick
Occurs when the timer ticks over the specified Interval.
public event EventHandler<object>? Tick