Wiki page timer changed with summary [] by Lauro Moura

This commit is contained in:
Lauro Moura 2015-12-10 12:32:19 -08:00 committed by apache
parent b6dbb57a1d
commit 1c946b291f
1 changed files with 23 additions and 9 deletions

View File

@ -4,41 +4,55 @@
**DRAFT** **DRAFT**
==== Constants ==== The Timer module provides flexible timer functionality.
==== Functions ==== ==== Functions ====
=== add(args) === === add(time, callback) ===
Syntax Syntax
<code javascript> <code javascript>
code function mycallback() { ... };
var timerObj = efl.Ecore.Timer.add(time, mycallback);
</code> </code>
Parameters Parameters
* parameters * time - A number with the time, in seconds, with the interval between consecutive activation of the timer.
* callback - A function taking no arguments to be called when the timer is triggered. It must return either ''efl.Ecore.Mainloop.RENEW'' (or 1) or ''efl.Ecore.Mainloop.Cancel'' (or 0). If it returns the former, it will be called again on the next tick (according to ''time''). If it returns the latter, it will be deleted automatically, making any references to the timer invalid.
Return value Return value
* return * object - An object wrapping the newly created timer.
* null - If it was not possible to add the timer.
=== addLoop(args) === Adds a new timer that will call ''callback'' after ''time'' seconds.
=== addLoop(time, callback) ===
Syntax Syntax
<code javascript> <code javascript>
code function mycallback() { ... };
var timerObj = efl.Ecore.Timer.addLoop(time, mycallback);
</code> </code>
Parameters Parameters
* parameters * time - A number with the time, in seconds, with the interval between consecutive activation of the timer.
* callback - A function taking no arguments to be called when the timer is triggered. It must return either ''efl.Ecore.Mainloop.RENEW'' (or 1) or ''efl.Ecore.Mainloop.Cancel'' (or 0). If it returns the former, it will be called again on the next tick (according to ''time''). If it returns the latter, it will be deleted automatically, making any references to the timer invalid.
Return value Return value
* return * object - An object wrapping the newly created timer.
* null - If it was not possible to add the timer.
Works like ''efl.Ecore.Timer.add'', but the reference "now" time is the time that the main loop ceased waiting for timeouts and/or events to come in or for signals or any other interrupt source. Use this UNLESS you absolutely must get the current actual timepoint.
=== timerObj.del() ===
=== dump(args) === === dump(args) ===