TimerMsgAtTime

Sends a message at a specific time.

Synopsis

TimerHandle TimerMsgAtTime (Item msgport, uint32 seconds, uint32 microseconds, uint32 userdata1, uint32 userdata2)

Description

Creates a timer that notifies you by message at the specified time. The timer is a one-shot; after sending a notification message the timer enters a suspended state. Use TimerReset() to reactivate the timer using new time values, or TimerCancel() to delete the timer.

The notification message is a SMALL message containing as values the userdata1 and userdata2 values specified in this call.

AtTime messages are useful primarily for synchronizing with real-world events. For a one-shot delay use TimerMsgDelay(). For a periodic series of messages, use TimerMsgHeartbeat().

The TimerServices thread must be active before calling this function.

Arguments

msgport
Port to which the notification message is sent.
seconds
Seconds portion of the time.
microseconds
Microseconds portion of the time. This value can be larger than 1 million.
userdata1
Value passed back to you in the msg_DataPtr field of the notification message.
userdata2
Value passed back to you in the msg_DataSize field of the notification message.

Return Value

A TimerHandle (a positive value) on success or a negative error code.

Implementation

Library call implemented in lib3do.lib.

Associated Files

lib3do.lib, timerutils.h

See Also

TimerMsgAfterDelay, TimerMsgHeartbeat