Syntax
function mycallback() { ... }; var timerObj = efl.Ecore.Timer.add(time, mycallback);
Parameters
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
Adds a new timer that will call callback
after time
seconds.
Syntax
function mycallback() { ... }; var timerObj = efl.Ecore.Timer.addLoop(time, mycallback);
Parameters
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
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.
Syntax
timerObj.del();
Deletes the callee timer object from the list of active timers.
Syntax
var log = efl.Ecore.Timer.dump();
Return value
This function returns a human-readable text-based log for Ecore Timer events.
Syntax
var precision = efl.Ecore.Timer.getPrecision();
Return value
Retrieves the current precision used by timer infrastructure.
Syntax
efl.Ecore.Timer.setPrecision(precision);
Parameters
This sets the precision for all timers. The precision determines how much of a difference from the requested interval is acceptable. One common reason to use this function is to increase the allowed timeout and thus, decrease the precision of the timers, this is because less precise the timers result in the system waking up less often and thus consuming fewer resources.
Be aware that kernel may delay delivery even further, these delays are always possible due other tasks having higher priorities or other scheduler policies.
Example: We have 2 timers, one that expires in a 2.0s and another that expires in 2.1s, if precision is 0.1s, then the Ecore will request for the next expire to happen in 2.1s and not 2.0s and another one of 0.1 as it would before.