Bridge

Timer Members

The Timer type exposes the following members.

Constructors


  Name Description
Public method Timer(TimerCallback, Object, Int32, Int32)
Initializes a new instance of the Timer class, using a 32-bit signed integer to specify the time interval. The delegate specified by the callback parameter is invoked once after dueTime elapses, and thereafter each time the period time interval elapses. If dueTime is zero (0), callback is invoked immediately.If dueTime is Timeout.Infinite, callback is not invoked; the timer is disabled, but can be re-enabled by calling the Change method.
Public method Timer(TimerCallback, Object, TimeSpan, TimeSpan)
Initializes a new instance of the Timer class, using TimeSpan values to measure time intervals. The delegate specified by the callback parameter is invoked once after dueTime elapses, and thereafter each time the period time interval elapses. If dueTime is zero (0), callback is invoked immediately.If dueTime is negative one (-1) milliseconds, callback is not invoked; the timer is disabled, but can be re-enabled by calling the Change method.
Public method Timer(TimerCallback, Object, UInt32, UInt32)
Initializes a new instance of the Timer class, using 32-bit unsigned integers to measure time intervals. The delegate specified by the callback parameter is invoked once after dueTime elapses, and thereafter each time the period time interval elapses. If dueTime is zero (0), callback is invoked immediately.If dueTime is Timeout.Infinite, callback is not invoked; the timer is disabled, but can be re-enabled by calling the Change method.
Public method Timer(TimerCallback, Object, Int64, Int64)
Initializes a new instance of the Timer class, using 64-bit signed integers to measure time intervals. The delegate specified by the callback parameter is invoked once after dueTime elapses, and thereafter each time the period time interval elapses. If dueTime is zero (0), callback is invoked immediately.If dueTime is Timeout.Infinite, callback is not invoked; the timer is disabled, but can be re-enabled by calling the Change method.
Public method Timer(TimerCallback)
Initializes a new instance of the Timer class with an infinite period and an infinite due time, using the newly created Timer object as the state object. Call this constructor when you want to use the Timer object itself as the state object. After creating the timer, use the Change method to set the interval and due time. This constructor specifies an infinite due time before the first callback and an infinite interval between callbacks, in order to prevent the first callback from occurring before the Timer object is assigned to the state object.

Methods


  Name Description
Public method Change(Int32, Int32)
Changes the start time and the interval between method invocations for a timer, using 32-bit signed integers to measure time intervals.
Public method Change(TimeSpan, TimeSpan)
Changes the start time and the interval between method invocations for a timer, using TimeSpan values to measure time intervals.
Public method Change(UInt32, UInt32)
Changes the start time and the interval between method invocations for a timer, using 32-bit unsigned integers to measure time intervals.
Public method Change(Int64, Int64)
Changes the start time and the interval between method invocations for a timer, using 64-bit signed integers to measure time intervals.
Public method Dispose
Releases all resources used by the current instance of Timer.