Libertas OS API Documentation
    Preparing search index...

    Function Libertas_TimerNew

    • Create a new timer.

      Parameters

      • timeout: number

        Positive timeout in milliseconds. If the timeout is 0, the timer is "put on hold"; use Libertas_TimerUpdate later to reschedule the timer.

      • func: LibertasTimerCallback

        Callback function.

      • Optionaltag: any

        Developer defined tag value to be passed over to the callback function.

      Returns LibertasTimer

      A new timer object.

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

      Both active timer and canceled 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 the same thread.