INtime SDK Help
WaitForRtAlarm
INtime SDK v6 > About INtime > INtime Kernel > Time management > WaitForRtAlarm

Waits on an alarm object for the given time interval, or until the alarm triggers.

BOOLEAN WaitForRtAlarm(
    RTHANDLE hAlarm         // handle for alarm event
    DWORD    dwMicroseconds // number of system timer ticks to wait for alarm
);

Parameters

hAlarm
Handle for the alarm.
dwMicroseconds
Interval in microseconds which the calling thread must wait for a message before returning. The value is converted to system timer ticks by the kernel.

Additional Information

Replaces the knWaitForRtAlarmEvent call, which is deprecated.

Note: The dwMicroseconds timeout parameter of WaitForRtAlarm() must be greater than the dwMicroseconds interval parameter used for CreatRtAlarm(). If it is not, the timeout is quietly adjusted to the alarm interval + 1 kernel tick.

Return Values

TRUE
Function was successful.
FALSE
Function Failed. To determine status, call GetLastRtError.

Status

E_TIME 0x0001
The call timed out before the alarm triggered. This status can occur if the dwMicroseconds parameter converts to a wait of zero ticks and the alarm has not yet been signaled. This feature can be used for polling the alarm.
E_TYPE 0x8002
The hAlarm parameter does not refer to a valid alarm object.
E_EXIST 0x0006
The hAlarm parameter is not a valid handle.
E_LIMIT 0x0004
The alarm object overflowed. This occurs because the alarm was signaled by more than 65535 timer events and none were ever received. When you receive this status the alarm must be reset by calling ResetRtAlarm before resuming normal operation.

Requirements

Versions Defined in Include Link to
INtime 4.0 intime/rt/include/rtbase.h rt.h rt.lib
See Also

Time