Skip to main content

TimerCreate

Callable

  • TimerCreate(callback: () => void, timeMs: number, repeat?: boolean, type?: background | foreground | universal): () => void

  • Creates a timer. Returns a function to remove the timer.


    Parameters

    • callback: () => void

      A function called when the timer expires

      • timeMs: number

        Time in ms before the timer expires

      • optionalrepeat: boolean = false

        Whether the timer should repeat. Default is false

      • optionaltype: background | foreground | universal = 'universal'

        The type of timer. Default is universal

      Returns () => void

      • A function to remove the timer.
        • (): void
        • Returns void