TimerReset

Restarts a timer using new values.

Synopsis

Err TimerReset (TimerHandle thandle, uint32 seconds, uint32 usecs_or_fields)

Description

Restarts a timer using new time values. If the timer was suspended, this reactivates it. If the timer was active, this stops the current action and restarts the timer with the new time values. This can be used to start a new delay even if the old one hadn't triggered yet.

For microsecond-based timers, pass both seconds and microseconds values. For VBL-based timers, pass zero for seconds and put the new field count in the usecs_or_fields parameter.

If an event had occurred for this timer and a notification message was sent, this function withdraws the notification message from your port. If you had already received the message but not yet replied to it, the timer is still restarted properly. In other words, you can respond to a timer event message by resetting the timer that sent the message, and you can safely do so before replying to the message.

Arguments

thandle
Handle for a timer created by one of the TimerMsg or TimerSignal functions.
seconds
New seconds value for the timer.
usecs_or_fields
New microseconds or field-count value for the timer.

Return Value

Zero on success or a negative error code.

Implementation

Library call implemented in lib3do.lib.

Associated Files

lib3do.lib, timerutils.h

See Also

TimerRestart