kaven-basic - v6.0.0
    Preparing search index...

    Function StartTimer

    • Starts a timer that executes the provided callback function at specified intervals.

      Parameters

      • callback: () => void | Promise<void>

        The function to be executed when the timer elapses. It can be either a synchronous function that returns void or an asynchronous function that returns a Promise<void>.

      • interval: number | ITimeSpan

        The interval at which the timer should fire. It can be either a number representing the time duration or an ITimeSpan object.

      • Optionalunit: "milliseconds" | "seconds" | "minutes" | "hours" | "days" | "weeks"

        The time unit of the interval if it's a number. Defaults to "milliseconds". This parameter is optional and is used only when interval is a number.

      Returns Timer

      An instance of the Timer class that has been started and is set to execute the callback at the specified interval.

      4.3.0

      2023-11-27