TimerMsgHeartbeat

Sends a message periodically.

Synopsis

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

Description

This function creates a timer that repeatedly notifies you by message at the specified interval. The timer continues sending notifications on a regular interval until you use TimerSuspend() to temporarily halt it or TimerCancel() to delete it.

The Heartbeat support in the TimerServices thread contains logic to prevent drift in the frequency of timer events. Messages are delivered at the specified frequency even if it takes you significant time to respond to each message event. If an entire frequency interval elapses and you still haven't replied to the prior message, you will miss one timer event but the frequency of subsequent events is not disturbed.

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 frequency.
microseconds
Microseconds portion of the frequency. 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

TimerMsgAtTime, TimerMsgAfterDelay, HZ_TO_USEC