Class Timer
Defines a timer to use for performing actions on a tick.
Inheritance
Namespace: MADE.Threading
Assembly: MADE.Threading.dll
Syntax
public class Timer : object, ITimer
Properties
| Improve this Doc View SourceDueTime
Gets or sets the time before initiating the first Tick event.
Declaration
public TimeSpan DueTime { get; set; }
Property Value
Type | Description |
---|---|
TimeSpan |
Interval
Gets or sets the interval between initiating the Tick event.
Declaration
public TimeSpan Interval { get; set; }
Property Value
Type | Description |
---|---|
TimeSpan |
IsRunning
Gets a value indicating whether the timer is currently running.
Declaration
public bool IsRunning { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
| Improve this Doc View SourceDispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Dispose(Boolean)
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | A value indicating whether the object is being disposed by the |
InvokeTick()
Invokes the Tick event, if attached.
Declaration
protected virtual void InvokeTick()
Start()
Starts the timer.
Declaration
public void Start()
Start(Int32)
Starts the timer after the given dueTime
in milliseconds.
Declaration
public void Start(int dueTime)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | dueTime | The time before initiating the first Tick event in milliseconds. |
Start(TimeSpan)
Starts the timer after the given dueTime
.
Declaration
public void Start(TimeSpan dueTime)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | dueTime | The time before initiating the first Tick event. |
Stop()
Stops the timer.
Declaration
public void Stop()
Events
| Improve this Doc View SourceTick
Occurs when the timer ticks over the specified Interval.
Declaration
public event EventHandler<object> Tick
Event Type
Type | Description |
---|---|
EventHandler<System.Object> |