Represents a function that operates on intervals. This function can be either synchronous or asynchronous.
The func variable can hold two types of functions:
IntervalFunction: A synchronous function that performs operations or computations within a specified interval.IntervalFunctionAsync: An asynchronous function that performs similar operations but allows for asynchronous processing.OptionalonA callback function that handles errors during the execution of an operation. This function will be invoked whenever an error is encountered.
If an ErrorHandler is provided, it should be a synchronous function that
processes the error immediately.
If an ErrorHandlerAsync is provided, it should be an asynchronous function
capable of handling errors with asynchronous operations.
OptionalstartDetermines the initiation mode of a process. It can be set to either:
'immediate': The process begins immediately without delay.'delayed': The process starts after the first timeout.Represents a duration of time. It can be either a number (milliseconds) or a function that returns a number based on the counter.
Interval parameters