Table of Contents

Class Timer

Namespace
MADE.Threading
Assembly
MADE.Threading.dll

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

TimeSpan

Interval

Gets or sets the interval between initiating the Tick event.

public TimeSpan Interval { get; set; }

Property Value

TimeSpan

IsRunning

Gets a value indicating whether the timer is currently running.

public bool IsRunning { get; }

Property Value

bool

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

disposing bool

A value indicating whether the object is being disposed by the Dispose() method.

InvokeTick()

Invokes the Tick event, if attached.

protected virtual void InvokeTick()

Exceptions

Exception

Potentially thrown by the Tick delegate callback.

Start()

Starts the timer.

public void Start()

Start(int)

Starts the timer after the given dueTime in milliseconds.

public void Start(int dueTime)

Parameters

dueTime int

The time before initiating the first Tick event in milliseconds.

Start(TimeSpan)

Starts the timer after the given dueTime.

public void Start(TimeSpan dueTime)

Parameters

dueTime TimeSpan

The time before initiating the first Tick event.

Stop()

Stops the timer.

public void Stop()

Events

Tick

Occurs when the timer ticks over the specified Interval.

public event EventHandler<object>? Tick

Event Type

EventHandler<object>