Edit

TimerItem Class

Definition

Defines a timer item to set up a timer. When the timer expires, a supplied callback is called. The timer item needs access to a TimerWheel in which the timer item is managed.

public ref class TimerItem
public class TimerItem
type TimerItem = class
Public Class TimerItem
Inheritance
TimerItem

Constructors

Name Description
TimerItem(TimerWheel, TimeSpan)

Initializes a new instance of the TimerItem class.

Properties

Name Description
IsStarted

Gets the current timer item status.

RemainingTime

Gets the remaining time span for TimerItem before the TimerItem expires.

TimerSpan

Gets the timer span value.

Wheel

Gets the timer wheel.

Methods

Name Description
Reset()

Resets the timer by rescheduling the item for a period of time equal to the original timer span.

Reset(TimeSpan)

Resets the timer by rescheduling the item for the new period of time specified.

Start()

Enables the timer item by setting the expiry time and adding the item to the queue.

Stop()

Disables the timer by removing the item from the timer queue and by resetting the expiry time.

Events

Name Description
Expired

Raised when the item expires.

Applies to