
63
Class Reference
4.3.1.9
setInterval
The
setInterval
method calls a function or evaluates an expression at specified
intervals in seconds.
The
setInterval
method will continue calling the function until
clearInterval
is
called, or the window is closed.
The ID value returned by
setInterval
is used as the parameter for the
clearInterval
method.
Format:
intervalId = reader.setInterval(function, interval_sec);
Where:
intervalId
– program provided interval ID.
function
– program provided function to run at the specified interval.
interval_sec
– amount of time (in seconds) to delay before running the function again.
4.3.1.10
clearInterval
The
clearInterval
method removes the instance of
setInterval
that has the handle
intervalId
.
Format:
reader.clearInterval(intervalId);
Where:
intervalId
– program provided interval ID.
4.3.1.11
setTimeout
The
setTimeout
method calls a function or evaluates an expression after a specified
number of seconds. The function cannot be an object method.
The
setTimeout
method will call the function passed to it after the set amount of time
unless
clearInterval
is called, or the window is closed.
The ID value returned by
setInterval
is used as the parameter for the
clearInterval
method.
Format:
timeoutId = reader.setTimeout(function, timeout_sec);
Where:
timeoutId
– program provided timeout ID.
function
– program provided function to run after the specified timeout.
timeout_sec
– amount of time (in seconds) to delay before running the function.