INtime SDK Help
RtSetTimerRelative (iwin32)
INtime SDK v7.1 > About INtime > Alternate APIs > iwin32 API > iwin32 API > RtSetTimerRelative (iwin32)

Sets the expiration time and repeat interval on the specified timer.

BOOLEAN RtSetTimerRelative(
    HANDLE hTimer,
    PLARGE_INTEGER pExpiration,
    PLARGE_INTEGER pInterval
);

Parameters

hTimer
Handle to the timer object, returned by RtCreateTimer.
pExpiration
Pointer to a LARGE_INTEGER structure that contains the time for the initial expiration relative to the current time, in 100ns units.

Although time is in 100ns units, the implementation uses the INtime system timer period (default 500us).

The actual number of INtime ticks the thread waits is calculated as follows:

interval = (parameter + ktick_in_100ns - 1) / ktick_in_100ns;

where: interval is the actual interval slept, ktick_in_100ns is the INtime low-level clock period expressed as a multiple of 100ns, and parameter is the value of the parameter passed.

pInterval
Pointer to a LARGE_INTEGER structure that contains the time between successive expirations, in units of 100ns.

Although time is in 100ns units, the implementation uses the INtime system timer period (default 500us).

The actual number of INtime ticks the thread waits is calculated as follows:

interval = (parameter + ktick_in_100ns - 1) / ktick_in_100ns;

where: interval is the actual interval slept, ktick_in_100ns is the INtime low-level clock period expressed as a multiple of 100ns, and parameter is the value of the parameter passed.

Remarks

RtSetTimerRelative sets the first expiration time and repeat interval for the timer. If the interval pointer is NULL or if it points to a LARGE_INTEGER value of zero, the timer expires only once.

Each time the timer expires, its handler function executes.

The value in 100ns units rounds to the system timer period.

A timer can be set only when not active; it must be an as already expired, one-shot timer or a timer stopped by calling RtCancelTimer.

Return Values

Non-zero
Success.
0 (zero)
Failure. For extended error information, see GetLastError.

Requirements

Versions Defined in Include Link to
INtime 3.0 intime/rt/include/iwin32.h iwin32.h iwin32.lib

Note

This function operates in the real-time portion of your application.

See Also