• Reset and update a timer.

    Parameters

    • timer: LibertasTimer

      An existing timer object.

    • timeout: number

      Positive timeout in milliseconds.

    • Optional func: LibertasTimerCallback

      Optional. If presented replaces callback function of old timer.

      Optional
    • Optional tag: any

      Optional. If presented replaces tag object of old timer.

      Optional

    Returns void

    Remarks

    func and tag cannot be reset to undefined or null. If arguments are undefined, original values will be kept.

    Timer is always one-off. When timeout is reached, the callback is called, the timer is then automatically cancelled as if Libertas_TimerCancel is called.

    Both active timer and cancelled timer can be reused by calling Libertas_TimerUpdate. Always try to reuse instead of creating new timers.

    Timer API is reactive API. Timers are driven by Libertas_WaitReactive. Never mix imperative and reactive API within same thread.

    See

Generated using TypeDoc