INtime SDK Help
INtime SDK v7.1 > 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


Handle for the alarm.
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

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


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.


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