A.Timer Class
alloy-ui/src/aui-timer/js/aui-timer.js:14
A base class for Timer.
Constructor
A.Timer
()
Index
Methods
_create
-
repeats -
ms -
fn
Creates a collection of timer definitions.
Parameters:
-
repeatsObject -
msObject -
fnObject
Returns:
_decrementNextRunTime
-
tasks
Subtracts the current time with the last run time. The result of this operation is subtracted with the task timeout.
Parameters:
-
tasksObject
_getNearestInterval
-
num
Calculates the nearest interval by using the modulus of the argument with the interval as reference.
Parameters:
-
numObject
Returns:
_lazyDestroy
()
protected
Checks if the timer is initialized and empty, then calls the
clearTimeout function using the global interval id.
_lazyInit
()
protected
Checks if the timer is initialized and contains a task, then calls the
setTimeout function and stores the global interval id.
_loop
-
i -
pendingTasks -
length
Goes through all pending tasks and initializes its timer or unregisters it depending on the task status.
Parameters:
-
iObject -
pendingTasksObject -
lengthObject
_resetNextRunTime
-
task
Resets the next run time.
Parameters:
-
taskObject
_runner
()
protected
Gets the arguments to call the _loop method.
A.clearInterval
-
id
Cancels repeated action which was set up using setInterval function.
Parameters:
-
idObject
A.clearTimeout
-
id
Clears the delay set by setTimeout function.
Parameters:
-
idObject
A.setInterval
-
fn -
ms -
context
Calls a function repeatedly, with a fixed time delay between each call to that function.
Parameters:
-
fnObject -
msObject -
contextObject
A.setTimeout
-
fn -
ms -
context
Calls a function after a specified delay.
Parameters:
-
fnObject -
msObject -
contextObject
clearInterval
-
id
Cancels repeated action which was set up using setInterval function.
Parameters:
-
idObject
clearTimeout
-
id
Clears the delay set by setTimeout function.
Parameters:
-
idObject
intervalTime
-
newInterval
Defines the fixed time delay between each interval.
Parameters:
-
newIntervalObject
Returns:
isRepeatable
-
task
Checks if the task is repeatable or not.
Parameters:
-
taskObject
Returns:
register
-
repeats -
fn -
ms -
context -
args
Adds a new task to the timer.
Parameters:
-
repeatsObject -
fnObject -
msObject -
contextObject -
argsObject
run
-
task
Runs the task function.
Parameters:
-
taskObject
setInterval
-
fn -
ms -
context
Calls a function repeatedly, with a fixed time delay between each call to that function.
Parameters:
-
fnObject -
msObject -
contextObject
setTimeout
-
fn -
ms -
context
Calls a function after a specified delay.
Parameters:
-
fnObject -
msObject -
contextObject
unregister
-
repeats -
id
Removes a task from the timer.
Parameters:
-
repeatsObject -
idObject