RTTimer Constructor (Clock, RTTimerCallback, Object, Int64, Int64) |
IMPORTANT! This constructor has been deprecated. It will be removed in a future release.
Namespace: IntervalZero.RTX64.RTAPI.ThreadingAssembly: IntervalZero.RTX64 (in IntervalZero.RTX64.dll) Version: 3.3.0.0 (File version: 3.5.0)

public RTTimer( Clock clock, RTTimerCallback callback, Object context, long dueTime, long period )
Parameters
- clock
- Type: IntervalZero.RTX64.RTAPI.ThreadingClock
A clock identifier as defined below in the Remarks section. - callback
- Type: IntervalZero.RTX64.RTAPI.ThreadingRTTimerCallback
A System.Threading.TimerCallback delegate representing a method to be executed. - context
- Type: SystemObject
A pointer to a context to be passed into the callback function. To ensure that any changes in the callback function are global, the parameter should be a reference type, such as a class. - dueTime
- Type: SystemInt64
The amount of time to delay before callback is invoked. Specify System.Threading.Timeout.Infinite to prevent the timer from starting. Specify zero (0) to start the timer immediately. Expiration is calculated relative to the current value of the clock associated with the timer at creation. The clock is specified in 100ns units. - period
- Type: SystemInt64
The time interval between invocations of callback. Specify System.Threading.Timeout.Infinite to disable periodic signaling. The clock is specified in 100ns units. See the comments section below for an explanation of "period" behavior.

- System - One millisecond timer
- RealTimeHAL - Real-time HAL timer. Default is 100 microseconds
- Clock3 - General purpose clock 3
- Fastest - The fastest available clock and time on the system
The timer routine will run as a separate handling thread. The "callback" and "context" perameters are used to control the creation of the handler thread.
To run a different handling routine/context, a new RTTimer object must be created.
In addition to creating the timer object and timer callback this function also sets the relative expiration time and repeat interval for the specified timer. If the repeat interval is non-zero then, after the first expiration, the timer will repeatedly expire at the specified interval. If the repeat interval pointer is NULL, then the timer will expire only once (i.e., it is a "one-shot" timer). Likewise, a non-NULL interval pointer may be passed in, with its value set to zero, for a one-shot timer. Upon each expiration of the timer, the handling thread is signaled to indicate the expiration, and the specified handling routine is run. The timer signals expirations only on the RTX64 timer interrupt boundaries. The RTX64 timer interval will be rounded up to the RTX64 HAL timer resolution. The highest RTX64 timer resolution is 1 ms. The behavior of the pInterval parameter is as follows:
- If you set the RTX64 interval to less than the HAL timer period, RTX64 will set the interval equal to the HAL timer period.
- The RTX64 interval must be a multiple of the HAL Timer period.
- If you specify an interval that is not a multiple of the HAL Timer period, RTX64 will force the interval to the closest multiple of the HAL Timer period.
- Two timers with the same interval as the HAL Timer period will necessarily have the same phase.
- If you specify an interval that is less than the HAL timer period (default to 100 microseconds), RTX64 will use the HAL timer period as the RTX64 interval instead of the interval you specified.
