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>.
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.
When true, invokes the callback once as soon as the timer starts; when false,
waits for the first interval. The immediate invocation is included in the timer's
invocation count. Defaults to false.
When false, waits for the current callback (including a returned promise)
to finish before scheduling the next invocation, preventing overlap. When
true, schedules first to maintain the configured cadence, allowing callbacks
to overlap when they run longer than the interval. Defaults to false.
An instance of the Timer class that has been started and is set to execute
the callback at the specified interval.
Starts a timer that executes the provided callback function at specified intervals.